2011-08-11 96 views
0

我想最初隱藏.noteHover,然後使用一個懸停事件,將淡入此類,然後非常迅速。這似乎在Chrome中工作正常,但我的問題是,在ff .noteHover仍然是顯示:沒有阻止淡入淡出效果的任何人,任何人都可以提供一些建議,我會出錯的地方?在Firefox中jquery淡入淡出問題

這裏是我的代碼:

/* Hover test */ 
     /* Hover test */   
     var $notes = $('.note'); 

     $notes.each(function() { 
     var thisNote = $(this); 
     var nestedNoteHover = thisNote.find('.noteHover'); 
     var nestedPath = thisNote.find('path'); 

     nestedNoteHover.hide(); 

     thisNote.hover(
      function() { 
      nestedPath.css('opacity', 0.8); 
      nestedNoteHover.fadeIn(100, function() { 
      nestedNoteHover.fadeOut(300); 
      }); 
      }, 
      function() { 
      nestedPath.css('opacity', 1); 
      } 
     ); 
     }); 

我已經更新了代碼,但仍然對FF沒有變化?

謝謝!

回答

1

我可能是錯在這裏,但看在jQuery`s find method後,我認爲與其

$(this).find($noteHover).fadeIn(100).fadeOut(300); 

它應該是:

$noteHover.fadeIn(100).fadeOut(300); // the variable you declared above... 
0

如果我正確地理解您的需求,這會做什麼你想要:

var noteHover = $('.noteHover').hide(); 
$('.note').hover(function() { /* on mouse enter */ 
    noteHover.fadeIn(400).fadeOut(100); 
}, function() { /* on mouse out */ 
    noteHover.hide(); 
}); 

Demo here