Saturday, December 5, 2009

[jQuery] Jquery unique ID

I'm a designer and totally lost when it comes to php or java script.
Perhaps somebody can help me.

I have several images when hover over it will display a DIV called
testing. The content is dynamically generated by wordpress. My problem
is when I hover over an image it displays all the div's with the class
"testing". What I need to do is somehow generate a random id by
Jquery.


<script type="text/javascript">
$(document).ready(function() {
var hide = false;
$(".rss-link").hover(function(){
if (hide) clearTimeout(hide);
$(".testing").fadeIn();
}, function() {
hide = setTimeout(function() {$(".testing").fadeOut
("slow");}, 500);
});
$(".testing").hover(function(){
if (hide) clearTimeout(hide);
}, function() {
hide = setTimeout(function() {$(".testing").fadeOut
("slow");}, 500);
});
});
</script>


<div class="testing" style="display: none;">this is my dynamic created
content </div>

Thank you in advance.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate