html - Jquery onclick triggered automatically? -


im building personal website , have links @ top hope make scroll appropriate section

i have 1 of links :

        <li><a id="aboutclick" href= ""><i class="tiny material-icons ">speaker_notes</i> about</a></li> 

and hoping redirect div

    <div id="about" class="container"> (insert me section etc...) 

anyway trying make happen

var aboutlink = document.getelementbyid('aboutclick'); var aboutdiv = document.getelementbyid('about'); aboutlink.onclick = aboutdiv.scrollintoview(); 

it works when first open page in tab/browser, if refresh, or go page again after visiting other websites, automatically scrolls about

how can stop this?

just sanity, can check there's no id appended url?

if there isn't there, can post js fiddle?


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -