2011-04-25 7 views
0

특정 시간 동안 마우스가 링크 위로 이동 한 후에 만 ​​팝업 애니메이션을 적용하는 방법. 도와주세요. Jquery 사용링크에 마우스를 올리면

+4

같은 일을 할 수 있다고 가정한다? –

+0

이 사이트에서 나는 "HoverIntent"buti dint를 2 회 사용해보십시오. http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html " – Karti

+0

나는 그것이 당신의 작품인가? 그렇다면 이미 그것을 원하는대로 해준다. 그렇지 않다면 , 지금까지 작성한 내용을 보여주십시오. –

답변

1
//Here is my trial 
//create a global var called canShow that will be set to true 
//as the mouse is over the cursor, and then reset when the mouse moves away. 
//then use timeout to display the popup after some interval 
//as long as the canShow hasn't been reset to false. 

var canShow = false; 
var desiredTimeOut = 2000; //in milliseconds 
var intervalId; 

//assume our link has id 'linkId' 
//we'll use jquery since you tag with it 
$('#linkId').hover(function(){ 
    canShow = true; 
    intervalId = setTimeout(function() { 
    if(canShow == true) $('#myPopupId').show(); 
    }, desiredTimeOut); 

}).mouseout(function() { canShow = false; clearInterval(intervalId);}); 
+0

더 나은 ... 나는 그것을 시도 할 것이다 – Ben

+0

감사 후 수행

Karti

관련 문제