i Need to scroll to div but i don't need the div to be on top of page after scrolling
i need it to be in of page how do i do that to be in
center of the page.
i see many question that make the scrolling right but to top of page i need it to scroll but make the div in center of the page.
i've tried this but this scroll it to top of the page
$('html,body').animate({
scrollTop: $("#"+div).offset().top},
'slow');
In order for the div to be centered in the window after scrolling you would need to:
top
valueNote: When your div is taller than the browser window, it will still be centered, but the top of the div will be off the screen!