我一直在研究我的问题,不想发布重复,但我已经尝试了我的研究中描述的方法,无法让我的函数延迟!setTimeout函数
有人可以看看,让我知道,如果我的语法有问题,为什么它不起作用?一切运行除了setTimeout函数
$(document).ready(function(){
$("#slider").easySlider({
auto: true,
continuous: true
});
$("#prevBtn a").hide();
$("#nextBtn a").hide();
$("#slider").mouseover(function(){
$("#prevBtn a").show();
$("#nextBtn a").show();
});
setTimeout(function(){
$("#prevBtn a").fadeOut('slow');
$("#nextBtn a").fadeOut('slow');
},3000);
});
你能设置在[的jsfiddle]演示(http://jsfiddle.net/)? – dunli
您的setimeout功能有效。我在里面放了一个console.log('hi'),我看到了它。 –
你隐藏了'#prevBtn a'和'#nextBtn a',然后在setTimeout中淡出它们,你可能是想用fadeIn(http://api.jquery.com/fadeIn/) – Gabriel