I have a catalog of products. When you rollover the thumbnail - description of the product appears in tooltip (Cluetip). I need a shadow to appear around the related image when Cluetip is activated.
For that I created separate div with shadow around image and This is how I target div when Cluetip activates:
onActivate: function() { $("#shadow").fadeIn(1000); }
But the problem is in my case CMS generates div's IDs dynamically, so they have names like #shadow6, #shadow8, #shadow17, etc.
My question is: How to target specific dynamic div's ID, once Cluetip is activated on it?
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 (In the loop)
<div id="shadow{$obj_id}" style="position: absolute; display:none;
width:150px; height:190px;"></div>
<div class="thumbnail">
<img src="/images/product.jpg" />
</div>
ACTUAL CODE
<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>