0
我試圖從每個縮略圖加載圖像並添加一個Opentip(opentip.org)。原型 - 函數內每個() - 只返回最後一個值
我已成功添加標籤並創建工具提示。唯一的問題是隻顯示數組中的最後一個值 - 對於每個縮略圖。
下面是一個產品的鏈接:http://www.inusual.com.br/poltrona-evo.html
原始的HTML是
<div class="ca-thumbnails"> <div> <img src="xxx"> </div> <div> <img src="xxx"> </div> </div>
我已經添加了隨機。一切工作正常,並正確添加到每個img。只有圖像沒有顯示好。
var tip = $$('.ca-thumbnails div img');
tip.each(function(s, index) {
src = s.readAttribute('src');
function image() {
return Builder.node('img', { 'src': src });
}
s.wrap('a', { 'class': 'tip', 'onclick':'return false;', 'href': src});
s.up(0).addTip(image, { ajax: false, showEffect: 'appear', showon:'mouseover', className:'glass', containInViewport: true, target: true, stem: true, tipJoint: [ 'center', 'bottom' ], targetJoint: [ 'center', 'top' ] });
我相信函數image()只獲取最後一項。
有沒有人有這方面的線索? 對不起,我的英語。
感謝
什麼是Builder? – clockworkgeek 2012-03-20 17:32:25