PHP – random div names?

  • Author
    Posts
  • #511271

    zefdesign
    Member

    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!

    #511484

    supportbot
    Member

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

The topic ‘PHP – random div names?’ is closed to new replies.