IT Certificaions

Google Cloud Platform

Saturday, December 15, 2012

Auto scroll to a DIV on page

You can set your page focus to a DIV on the basis of id element.

Let's say you have an element...
         <div id="my_div" >  Scroll here.... </div>

Always Use: document.getElementById('my_div').scrollIntoView();