As someone who is just starting to explore jQuery, I hope you can bear with me.
I've implemented this styling:
html, body{
height: 100%;
overflow: auto;
}
Along with this script:
$(document).ready(function() {
$('#guide-wrap').scrollTop($('#main').position().top);
});
Currently, when the window loads, it immediately shifts to the div
with the id of main
. However, what I really want is for it to animate smoothly. Unfortunately, my attempts to do so using the following script have not been successful due to my existing CSS properties:
$('html,body').animate({scrollTop: 0}, 'slow');
Perhaps I'm missing something or doing it wrong. I've tried searching online extensively before reaching out here for assistance. Any guidance from you experienced folks would be greatly appreciated as I continue to learn and grow in my knowledge of jQuery. Thank you!