2

I have a simple hover fadeIn and fadeOut as you will see in my code. The problem is that to prevent the fadeIn/Out from happening a 100 times i have to use .stop() before i call fadeIn/Out, but the stop seems to freeze the elements fade and then when you hover back over it will only fade in as far as you let it, you can see an example here: http://ena.vu/jhover/jhover.html

and the jQ code is:


obj.children().hover(function(e){ 
$(this).find("."+options.title_class).stop().fadeIn(options.title_speed);
},function(){
$(this).find("."+options.title_class).stop().fadeOut(options.title_speed);
});
agrublev
  • 748
  • 1
  • 8
  • 22

2 Answers2

3
obj.children().hover(function(e){  
$(this).find("."+options.title_class).stop().fadeTo(options.title_speed,1); 
},function(){ 
$(this).find("."+options.title_class).stop().fadeTo(options.title_speed,0); 
});

I am sure this will work for you. Read more on fadeTo

Tyde
  • 242
  • 1
  • 3
  • 11
  • you are absolutely correct, that worked like a charm. Now only if i could find a way to do the same for the slideUp and slideDown effect :( – agrublev Dec 08 '10 at 19:09
  • You can use the animation function that can move objekt. I don't have a code from the top of my head, but have a look here http://api.jquery.com/animate/ – Tyde Dec 10 '10 at 08:51
0

You can use this,it may helpful to you

obj.children().mouseover(function(){ $(this).find("."+options.title_class).stop().fadeTo('fast', 1).show();

}).mouseout(function(){ $(this).find("."+options.title_class).stop().fadeOut('fast'); });

KillerFish
  • 5,042
  • 16
  • 55
  • 64