jquery issue please help

Discussion in 'jQuery' started by Wp-Mod.Com, Jan 25, 2010.

  1. #1
    i have this code

    var fadecolor = '#008000';
        var fadeduration = 600;
        var original = $wpmod('.comments-no a').css('color');
        $wpmod('.single').hover (
          function() { 
            $wpmod('.comments-no a').animate({ color: fadecolor },fadeduration);
          },
          function ()
          {
            $wpmod('.comments-no a').animate({ color: original },fadeduration); 
          });
    Code (markup):
    when i hover over my 'single' class [as mentioned in the code] , all the links in that single should fade to a diffrent color, the funny thing that is happening whenver i hover over the 'single' class , all the links fade but , of all the posts which have 'single' class , whereas i just want it to change the color of links only on the post that is hovered and not all together

    image preview

    when nothing is hovered links color remains grey
    [​IMG]

    when one post is hovered - but links of other post change color when hovered over one post
    [​IMG]
     
    Wp-Mod.Com, Jan 25, 2010 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    i am not a jquery expert - but this prototype works:

    http://www.jsfiddle.net/vrdCN/1/

    change .css to animate or whatever works for you, but this one way to get to the the comments a only within the post itself.
     
    dimitar christoff, Jan 26, 2010 IP
  3. alextera

    alextera Peon

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You should use jQuery Color Animations plugin
     
    alextera, Jan 26, 2010 IP