Goto the Div Position - JavaScript

HTML
--------
<div id="design_start">
Your content here
</div>
<button onclick="goto_top_position();">Move to design area</button>

JS
------
function goto_top_position()
        {
            $('html, body').animate({
                scrollTop: $("#design_start").offset().top
            }, 1000);
        }


This code will take the scroll to the div position with animation

Popular posts from this blog

[Solved] Hive installation error: java.net.URISyntaxException: Relative path in absolute URI

Install Android SDK in centOs

Installing arules package (Association Rules) in R