我有一个产品目录。当您翻转缩略图时 - 产品描述出现在工具提示(Cluetip)中。 Cluetip激活时,我需要在相关图像周围出现阴影。一旦Cluetip激活,如何定位单独的动态div?
对于我创建了全景图像阴影和 单独的DIV这是我的目标股利时Cluetip激活:
onActivate: function() { $("#shadow").fadeIn(1000); }
但问题是在我的情况CMS动态生成div的标识,所以他们的名字像#shadow6,#shadow8,#shadow17等
我的问题是:一旦Cluetip被激活,如何定位特定的动态div的ID?
的jQuery:
<script type="text/javascript">
$(document).ready(function() {
$('.thumbnail').cluetip({
fx: {
open: 'fadeIn',
openSpeed: '2000'
},
showTitle: false,
cursor: 'pointer',
positionBy: 'auto',
height: '210px',
topOffset: 0,
leftOffset: 20,
local: true,
sticky: true,
mouseOutClose: true,
onActivate: function() {
$("#shadow").fadeIn(1000);
},
onHide: function() {
$("#shadow").fadeOut(300);
}
});
});
</script>
HTML/PHP(在环)
<div id="shadow{$obj_id}" style="position: absolute; display:none;
width:150px; height:190px;"></div>
<div class="thumbnail">
<img src="/images/product.jpg" />
</div>
实际代码
<div id="shadow1"></div>
<a href="/shoe-model-name.html">
<span class="cm-template-box" template="common_templates/image.tpl" id="te3">
<img class="cm-template-icon hidden" src="/skins/test/customer/images/icons/layout_edit.gif" width="16" height="16" alt="" />
<img class="thumbnail" rel="#popupz1" src="/images/product-tmb.jpg" width="150" height="180" alt="" /></span>
</a>
触发工具提示的元素是否与阴影元素相关?你的标记是什么样的? – m90 2012-03-30 06:30:28
刚添加标记。 – Tim 2012-03-30 06:47:26
我想达到像这样的效果:[链接](http://www.gucci.com/us/category/f/women_s_shoes) – Tim 2012-03-30 06:51:15