How do move focus to a different section (named anchor) on the same page after doing some jquery processing.
Function ABC() does some processing and afterwards, I need to move the user to a section on the same page (further down the page).
You can use the code below to scroll the screen to a <div id="navigation">
. Just change the selector to match the element you want to scroll to.
$('html, body').animate({ scrollTop: $('#navigation').offset().top }, 'slow');
location.href=location.href.replace(/#.+/,'')++'#namedanchor'
or
document.getElementById('#namedanchor').scrollIntoView(true)
The first appends the hash to the address URL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With