Make content in an iFrame start at the bottom when page loaded
I have an iframe, well it's开发者_开发百科 exactly an iframe, its a div with a scroll overflow.
I want it to start scrolled to the bottom when the page is loaded
Is this possible with Jquery?
And if so, how?
Thanks!
Take a look at this solution: Scroll to bottom of div?. Andsien's answer uses jQuery and is just one line of code; here's the code he gave wrapped in the document ready function:
$(document).ready(function(){
$("#mydiv").scrollTop($("#mydiv")[0].scrollHeight);
});
Yes I did one before. I used the following library:
http://flesler.blogspot.com/2007/10/jqueryscrollto.html
精彩评论