我想要做以下事情 - 一旦我點擊一個href表單容器滑落,沒有問題。我也嘗試將頁面向下滾動到底部(平滑,動畫滾動),以便在滑動過程中可以查看內容。觸發滑動後滾動到底部?
我嘗試:
<a class="enter" id=slide href="#bottom"></a>
<div class="form-container">
</div>
<script type="text/javascript">
$("#slide").click(function() {
$('.form-container').slideToggle();
});
$("a[href='#bottom']").click(function() {
$('html, body').animate({
scrollTop: $(document).height()-$(window).height()},
1400,
"easeOutQuint"
);
});
</script>
'ID = slide'應該是'ID = 「幻燈片」' – StaticVariable