Can anyone help me with implementing an auto scroll to each div or element when the user scrolls using the mouse? Here is the scenario:
Imagine this structure of the page...
<div id="main-wrap">
<div class="my-div-1">
<p>here goes my content 1</p>
<img src="/images/sample-1" alt="sample-1"/>
</div>
<div class="my-div-2">
<p>here goes my content 2</p>
<img src="/images/sample-2" alt="sample-2"/>
</div>
<div class="my-div-3">
<p>here goes my content 3</p>
<img src="/images/sample-3" alt="sample-3"/>
</div>
</div><!-- end of main-wrap id -->
-If each div has enough content to make the page long, and a user is viewing my-div-1, how can I automatically scroll to my-div-2 when they scroll down instead of through the whole div?
I hope that makes sense. Any advice on implementing this feature using JavaScript and JQuery would be greatly appreciated.
Thank you in advance for any assistance.