Skip to content
Advertisement

Best way to scrolldown onpageload

I have the following code:

JavaScript

The previous code attempts to scroll down after page loading.

Is there any problem, as it doesn’t work for me?

Advertisement

Answer

instead of window.onload use

JavaScript

because window.onload is fired when entire page load and document.ready is fired when DOM loads and use srcollTo instead of scroll

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement