Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery in a WordPress loop

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28470
    Techguy172
    Member

    Hey guys,

    So I’m trying to use jquery in a wordpress loop, and i’ll start off by saying I’m new to jquery so this is a learning experience. I’m trying to jquery to display information about the post when you roll over the image, I’m able to do that now but the problem is when I roll over one image, It displays the information for all the images, when I only want it to show it for the image I’m on. I think the problem is I’m using the same class name for every image. I don’t know whether I need to generate a different class name for each item, and get it that way in jquery, or if there’s another way. Either way I’m out of ideas and don’t know what to do.

    Thanks in advance.

    Code:
    ID, ‘key’, true );?>

    And my current jquery.

    Code:
    $(document).ready(function(){

    $(“.hoverImage”).hover(function(){

    $(“.MoreInfo”).removeClass(‘aHover’);

    },function(){

    $(“.MoreInfo”).addClass(‘aHover’);

    });

    });

    CSS

    Code:
    .aHover { display: none; }
    #72790
    Techguy172
    Member

    No, I’m afraid that did nothing, before it would show all of them, now nothing happens upon hover.

    Here’s a video showing the problem: http://www.youtube.com/watch?v=Lvjh_323dgs

    Any other ideas, thanks for trying

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.