Twitter bootstrap 将模态窗口引导滚动到底部

Twitter bootstrap 将模态窗口引导滚动到底部,twitter-bootstrap,Twitter Bootstrap,我有一个动态高度(超过屏幕高度)的模态窗口引导。如何以编程方式将窗口滚动到底部?我试着这样做: $('#modal').animate({ scrollTop: $('#modal').height() }, 500); 但是变量$('#modal').height()在我调整窗口大小时并没有改变。 有什么想法吗?解决方案非常简单: $('#modal').animate({ scrollTop: $('#modal .modal-dialog').height() }, 500); 另一个

我有一个动态高度(超过屏幕高度)的模态窗口引导。如何以编程方式将窗口滚动到底部?我试着这样做:

$('#modal').animate({ scrollTop: $('#modal').height() }, 500);
但是变量$('#modal').height()在我调整窗口大小时并没有改变。
有什么想法吗?

解决方案非常简单:

$('#modal').animate({ scrollTop: $('#modal .modal-dialog').height() }, 500);

另一个解决方案对我不起作用,但很接近

以下是对我有效的方法:

$('#modal').animate({ scrollTop: $('#modal .modal-content').height() }, 'slow');

用于将引导模式窗口滚动到底部, 以下是对我有效的方法:

$('#modal .modal-body').animate({ scrollTop: $('#modal .modal-body').offset().top }, 'slow');

请尝试添加溢出:隐藏;当你滚动模态的时候,请转到主体。谢谢你的评论。我解决了这个问题。