0
我尝试将这样的功能组合起来,但不会为我工作。联合功能
- 面板将显示1秒
- 面板向上滑动
- 幻灯片BTN会走出视口的一个很短的时间
- 结束:幻灯片BTN显示在正确的位置
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#panel").slideToggle("slow");
$(this).toggleClass("active"); return false;
});
$('#panel').html('This text will dissapear after 3 seconds.');
timeout = setTimeout(function() {
$('#panel').animate({marginTop: '-450px'}, 500);
},
function aha() {
$('.btn-slide').animate({marginTop:'-40px'}, 350);
$('.btn-slide').animate({marginTop:'470px'}, 350);
}), 1000)
});
我需要你的帮助。
'setTimeout'接受一个函数和一个整数,而不是两个函数。另外,你有一个语法错误:'Uncaught SyntaxError:Unexpected token)' – Eric
你能解释一下按钮按下是如何适合你的一系列操作的吗? – Eric