Need help with jquery replace

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

  1. #1
    hy this is my code

      $wpmod('.single').hover( function () {
        if ( $wpmod(this).is(':animated') ) {
          $wpmod(this).stop(true,true);
        }
        var thesrc = $wpmod(this).attr('src');
        thesrc = thesrc.replace('.png','2.png');
        $wpmod(this).hide();
        $wpmod(this).attr('src',thesrc);
        $wpmod(this).fadeIn('normal');
      }).mouseout( function () {
        if ( $wpmod(this).is(':animated') ) {
          $wpmod(this).stop(true,true);
        }
        var thesrc = $wpmod(this).attr('src');
        thesrc = thesrc.replace('2.png','.png');
        $wpmod(this).hide();
        $wpmod(this).attr('src',thesrc);
        $wpmod(this).fadeIn('normal');
      });
    Code (markup):

    now the problem is that whenever someone hover's over 'single' , i want the icons in the post to change image , but only certain icons should only change , what line to add so that only particular class image icons change when hovered over single
    for e.g.
     
    Wp-Mod.Com, Jan 23, 2010 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Well, this doesn't seem to complex but it would be better if you can show it on a link somewhere. Its little difficult to identify when you say "only certain icons should change"! Can you give idea of what icons should change? May be then we will be in better position to help you out..
     
    mastermunj, Jan 23, 2010 IP
  3. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    [​IMG]

    here is the thing i want then to be replaces whenever hover over the whole post
     
    Wp-Mod.Com, Jan 23, 2010 IP
  4. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    and if possible please tell me the code on how to fade the links color too when hover over the post
     
    Wp-Mod.Com, Jan 23, 2010 IP
  5. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #5
    mainly you want color of heading, author, keywords and Edit This to change at same time on hover ??
    Then you need to modify above js to change class of the elements you want to give hover effect.
    I am not so good with jQuery, but I can always give you ideas of what to do and how, you can they try it out while learning :)
     
    mastermunj, Jan 24, 2010 IP
  6. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i actually dont know where to start editing that the main point and no knowlege on jquery , so if you can point out i might be able to ask or search somewhere out
     
    Wp-Mod.Com, Jan 24, 2010 IP