仅在鼠标经过链接一段特定时间后才能为弹出窗口设置动画。请帮忙。使用Jquery。????
答案 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);});
答案 1 :(得分:0)