I have a list of pictures being pulled from the standard flickr API, and they all go in a list like this:
<div id="listImgFlickr">
<div id="jflickrwrap">
<div class="listImgs-box">
<div class="listImgs">
<p style="display: none"></p>
<a class="thickbox" href="image.jpg" rel="index"><img src="image.jpg"></a>
</div>
</div>
<!-- rinse and repeat over and over -->
</div>
</div>
and i have this jQuery script
jQuery("a").hover(function(){
alert('maoe!');
})
the thing is: the script works for each and every link element on the page, except for the ones on the list. On the other hand, Thickbox is working fine, which means it can detect the links ok.
So, i’ve checked this:
- jQuery is being included only once
- the script that generates the list is on the header
- thickbox is on the footer
- test script above is also on the footer (after thickbox).
- I’ve also tested that script with
mouseover,mouseenterandclick, and setting it to"p","a.thickbox","img"and still nothing.
Any clues?
if you’re loading these elements with ajax you should use
.live()instead ofhover()also,
.live()has been deprecated as of 1.7 so depending on what jQuery version you use, consider using.on()instead. more information here