PHP – random div names?
-
I have a piece of php I’m using on wordpress blog posts. It is a simple fade in/ fade out, but it works by knowing the div’s exact class.
<script type="text/javascript"> jQuery(function(){ jQuery('.story-wrap').mouseenter( function(){ jQuery('.dates .a').fadeOut(300, function(){ jQuery('.dates .share').fadeIn(300); }); } ); jQuery('.story-wrap').mouseleave( function(){ jQuery('.dates .share').fadeOut(300, function(){ jQuery('.dates .a').fadeIn(300); }); } ); }); </script>
It works great but when I use it on an archive page and there is more than one instance of the div class, they all react at the same time. I want each div to react separately, eg you hover div one and only div one reacts not every div.
Is there some way I can create a random div name each time dynamicaly and have the script work with that somehow??
Thanks so much for any help!
- The topic ‘PHP – random div names?’ is closed to new replies.