2012-10-24 100 views
3

我想要做以下事情 - 一旦我點擊一個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> 
+0

'ID = slide'應該是'ID = 「幻燈片」' – StaticVariable

回答

0

使用本

$("#slide").click(function(e) { 
    e.preventDefault(); 
    $("html, body").animate({ scrollTop: $(document).height() }, "slow"); 
    return false; 
}); 
+0

真棒!謝謝你 – Dave

+0

+1現在你可以upvote – StaticVariable