2012-02-02 51 views
0

我有這個代碼,它顯示了一個盒子裏的工具提示,裏面有「tooltip-container」的id - 目前它只是彈出...我怎麼才能使它淡入淡出和淡出滾動?將淡入淡出效果應用於工具提示?

當前代碼:

$(document).ready(function(){ 
    $('.tippytrip').hover(function(){ 
    var offset = $(this).offset(); 
    console.log(offset) 
    var width = $(this).outerWidth(); 
    var tooltipId = $(this).attr("rel"); 
     $('#tooltip-container').empty().load('tooltips.html ' + tooltipId).show(); 
     $('#tooltip-container').css({top:offset.top, left:offset.left + width + 10}).show(); 
    }, function(){ 
     $('#tooltip-container').hide(); 
}); 
    }); 

回答

1

,而不是.show()使用.fadeIn(timeInMS) 同爲.fadeOut()

+0

謝謝你:) – user1145334 2012-02-02 13:23:18

1

你可以就在你的節目中添加一個時間段()和隱藏()方法...

.show(1000); // takes 1 second to fade in 
.hide(1000); // takes 1 second to fade out 
+0

謝謝,讚賞 – user1145334 2012-02-02 13:23:31

+0

沒問題的隊友:) – Archer 2012-02-02 13:24:22