Comments (3)
At present you actually can't. The way the script is written, calling init
cancels out any previously existing one.
There are different ways to structure the plugin to avoid this, but it would require me to rewrite some stuff, and I don't have time to commit to that at the moment.
Sorry about that!
from gumshoe.
I understand you are busy, still - thanks for the great plugin! :)
I could try to do it myself ... From what I understand I could mod the "deactivateCurrentNav" method to possibly walk only items in the current menu tree? Would that do the trick?
Quick question - is the Minified version of the script in the DIST folder somehow different than the regular one? Couldn't seem to find the "deactivateCurrentNav" method in there?
Thanks again for your work and time spent, it's well appreciated! :)
from gumshoe.
The script will destroy any current implementation if you try to reinit it with a different selector. You might be able to most easily hack this by just removing the destroy
method. I think that alone would get you what you're looking to do.
If you decide not to do that or it doesn't work, on init
, the script grabs all of the nav items and catalogs and crawls them as you scroll. Then it activates just the first one that matches. You'd need to make it not bail once it finds a match, and probably modify deactivateCurrentNav
as well.
The minifier I use is very aggressive, so it changes all of the non-public function names. Anything that can be called with gumshoe
retains its name (gumshoe.init()
, gumshoe.destroy()
, etc.), while anything that's just set as a var
gets it's name changed to a single character to reduce filesize.
So deactivateCurrentNav
might get renamed g
, for example. As such, you definitely want to work with the src
version of the file, or at least the unminified dist
.
from gumshoe.
Related Issues (20)
- remove required <li> HOT 1
- Cannot read property 'content' of undefined HOT 5
- active class not being applied on link – v4 HOT 4
- First element looses 'active' class on overshoot HOT 1
- TypeError: e is undefined gumshoe.min.js:2:1240 HOT 11
- (gumshoe) How to delay (debounce) spy adding active class to LI BUT ONLY after click event ? HOT 2
- Support for body overflow hidden and independently scrolling grid columns? HOT 1
- isAtBottom isn't always correct on High DPI screens HOT 2
- Fixed Header Offset not working HOT 1
- [Click Interaction] Click interaction improvement for navigation items at bottom, whose content height is not enough to reach the offset.
- [Feature request] Option to disable isAtBottom
- Issue with applying directly to link element and nested menu
- Custom events not working HOT 2
- Add support for Typescript HOT 1
- Overflow problem?
- webpack cannot find gumshoe dependency (v4.0.1) HOT 7
- Standardize documentation
- Headers instead of section divs HOT 4
- Fixed header offset demo missing HOT 6
- Add support for another markup HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gumshoe.