2

this is my first StackOverflow post. So I hope my question fits the standards.

I'm working on creating my own website using the YAML CSS Framework. ( http://www.yaml.de/docs/index.html )

On that page, they have it so as you scroll, the navigation menu stays at the top of the screen. When I downloaded the framework, I found the below code in their domscript.js file. So I understand that they added a class so it would stick.

What I would like to do is have a second menu of the same kind with different links right below it. I copied and pasted the html code for the menu right below it and a second one did appear. But as I scroll down, only the first one stays.

Any ideas on how I can get the second one to stay as well?

if (hOffset < top) {
    if (nav.data(stickyClass) !== true) {
        nav.addClass(stickyClass).data(stickyClass,true);
    }
} else {
    if (nav.data(stickyClass) !== false) {
        nav.removeClass(stickyClass).data(stickyClass,false);
    }
}
Paolo
  • 20,112
  • 21
  • 72
  • 113
Merlin -they-them-
  • 2,731
  • 3
  • 22
  • 39

1 Answers1

1

Yes, because an ID can use only once. If you want to this type of menu you have to create another id & copy the .js file & change the ID in that .js file. I think this will work.