Forum Moderators: open
function abc() {
document.getElementById('somediv').scrollTop = document.getElementById('somediv').scrollHeight;
document.getElementById('somediv').scrollLeft = document.getElementById('somediv').scrollWidth;
}
and this function is called in "body onload" event (the "somediv" has scrollbars with overflow:auto; style).
If I change the event from "onload" to some "onclick" event, it's work.
What can I do?
Perhaps you need to post a stripped-down test HTML page.
Make sure the event isn't being fired before the page has finished loading. You could embed the JS at the bottom of the page, but check the difference between onload and DOMContentLoaded