Onclick menu button, website scrolls to div

zot3 picture zot3 · Feb 28, 2014 · Viewed 11.9k times · Source

I'm making a personal portfolio in an infinte scroll website. Right now I have 4 divs (home, bio, work and contact). I have an header with a menu with 4 names, same as divs. So what I want to do is to have a trigger when I'm at the div "Home" and click on the menu "Work" I want the browser to scroll down to the third div whick is "Work". Hope I make myself clear :)

Answer

Jatin picture Jatin · Feb 28, 2014

For something really basic use this:

<a href="#work">Work</a>

or you can try jQuery plugin ScrollTo

Working Fiddle