Scrolling to an anchor link with jQuery -


this question has answer here:

i have link @ top page linked #here. how can make page scroll down anchor link #here? i've been going google , jquery site, don't know do. js code i've got.

html:

<div class="container">     <div class="header">        <a class="link" href="#here">here</a>     </div>      <div class="footer">        <a id="here"></a>        <p>some text...</p>     </div> </div> 

js:

$('.link').click(function() {     $(this).scroll() }); 

you can add:

$('.link').click(function() {   $("html, body").animate({ scrolltop: $('#here').offset().top }, 1000); }); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -