Aerolab / midnight.js

Switch your nav's design on the fly
http://aerolab.github.io/midnight.js/
Other
3.67k stars 380 forks source link

Multiple fixed elements #55

Closed ekfuhrmann closed 7 years ago

ekfuhrmann commented 7 years ago

Is it possible to have this work with multiple, different elements fixed in different areas of the page? Think like a left and right sidebar, both transitioning differently as you scroll down the page?

As it stands, it seems that any data-midnight field I make is being applied to EVERY instance, rather than targeting them to specific elements.

RobertoGonzalez commented 7 years ago

While we've never tested that use case, the code is written so it supports multiple navs (you just need to run the plugin once for each one of them). If there's an issue with that (maybe an incorrect selector somewhere?), we'd be happy to accept a PR addressing that use case.

Cheers!

ekfuhrmann commented 7 years ago

It seems like #38 is basically what I was asking for. I basically need a unique data-midnight field for each element I wish to apply the midnight.js to.

RobertoGonzalez commented 7 years ago

@ekfuhrmann I merged that fix to gh-pages with some quick documentation. It's been tested sparingly, but it should work. Let me know if you find it useful!