我試圖在頁面底部添加一個滑動橫幅,但橫幅開始打開而不是關閉。我怎樣才能讓它開始關閉?jquery slide banner start close
$(function() {
var open = false;
$('#footerSlideButton').click(function() {
if(open === false) {
$('#footerSlideContent').animate({ height: '300px' });
$(this).css('backgroundPosition', 'bottom left');
open = true;
} else {
$('#footerSlideContent').animate({ height: '0px' });
$(this).css('backgroundPosition', 'top left');
open = false;
}
});
});
我也意識到,橫幅只關閉第二次嘗試點擊關閉按鈕/酒吧 – 2014-10-07 17:15:30
確定通過將第二行上的「false」更改爲「true」來解決2點擊事件。我不知道它做了什麼,但它現在的工作只需點擊一下。但開始關閉問題我不知道如何解決它..:S我是新手在jquery – 2014-10-07 17:24:26