Smoothly scroll to a div

$("#button").click(function() { $('html, body').animate({ scrollTop: $("#myDiv").offset().top }, 2000); });
Smoothly scroll to a particular div when clicking on a button or a link.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.