tags:

views:

34

answers:

1

Hi! Im having a issue within a hover that is inside a .everytime(2000)...

j("#ifr").everyTime(2000,function(){...
j.ajax({
 url: "script.php",
 cache: true,
 success: function(html){

j(".chatline").hover(function(){
var did = j(this).attr('rel');
j("#status-"+did+":hidden").fadeIn('fast');
...}

the problem is that when .everytime fires the .hover refires and then it blinks because its has hidden class. Tried unbind('mouseenter mouseleave').hover(function){... but no change.

Is there any way of solving this ?

A: 

Try adding display:none to whatever you are hiding since it sounds like your div isn't initially hidden and that is why you are seeing the blinking.

EDIT

Instead of rebinding everytime in the success callback why not use live to bind. This will handle the case when new HTML is added to the DOM.

j(".chatline").live('mouseover mouseout', function(){
var did = j(this).attr('rel');
j("#status-"+did+":hidden").fadeIn('fast');
...
});

j("#ifr").everyTime(2000,function(){...
j.ajax({
 url: "script.php",
 cache: true,
 success: function(html){ 
             ... 
});
amurra
the hidden class is defined in css as display:none , so it has no effect changing to display:none straight into the div style.
Thundercat
it must be blinking because its hidden, and when i hover it when .everytime fires it fadeIn again. that's what i want to get rid of :)
Thundercat
Hmm...why doesnt anyone reply when its not a brand new thread? :s
Thundercat
@Thundercat - If there is no new activity some people will think the question is dead.
amurra
thank you amurra :) Will test your edit in a sec.. Much appreciated!
Thundercat