1

I'm currently using the jquery plugin one page scroll (http://www.thepetedesign.com/demos/onepage_scroll_demo.html)

I want to keep the stock navigation that gets added on the right side, but I also have a fixed navbar were I want the links to navigate to the different divs on the index.html file.

I was thinking to give each div a specific id, but how I would I get the navigation to work with the smooth scrolling?

Dondada
  • 421
  • 9
  • 25
  • 1
    You may consider to use [fullPage.js](http://alvarotrigo.com/fullPage/) instead. The navigation you try to create sounds like a menu for me, which is linked to the sections. This is very simple to accomplish with fullPage.js – Alvaro Nov 26 '13 at 16:44

2 Answers2

0

Animate scroll to ID on page load

Here it is, with this piece of code, you can scroll on a page smoothly.

$("html, body").animate({ scrollTop: $('#objectToScroll').offset().top }, 1000);
Community
  • 1
  • 1
androbin
  • 1,622
  • 14
  • 31
  • Needs to work with the plugin I posted. It takes care of hiding and showing each individual div. – Dondada Nov 26 '13 at 16:19
0

Just use classes, not id's, then you can apply the same class to multiple elements. Hence, your horiz nav can have the same links as the sidebar dots/right navigation.

Nathaniel Flick
  • 2,902
  • 2
  • 22
  • 31