Comments (6)
Hi and thanks very much for your input! 👍
Indeed, in the current version the addon is initialized just once ondomready and any navbars that are added in the DOM dynamically after that won't be initialized. So it really makes sense to rework the addon and expose some init method that could be called at any time. I will try to do this in the next few days and will post back. Stay tuned..
from smartmenus.
That'd be great! Thank you so much.
from smartmenus.
OK, I just committed the updates. You can grab the code from here (note that the core also needed some changes so it's a good idea to use the updated one below to avoid any issues):
https://raw.githubusercontent.com/vadikom/smartmenus/master/src/addons/bootstrap/jquery.smartmenus.bootstrap.js
https://raw.githubusercontent.com/vadikom/smartmenus/master/src/jquery.smartmenus.js
All updates will be included in the next release so you don't need to worry about upgrading in the future.
You can now call $.SmartMenus.Bootstrap.init()
when your navbar is available in the DOM. It's not a problem to call it multiple times, it will only handle navbars that are still not initialized.
Note that the following methods might also be handy (you can use them just fine with the Bootstrap addon, just set some id to your ul.navbar-nav
so you can call them for it):
http://www.smartmenus.org/docs/#refreshInstance
http://www.smartmenus.org/docs/#destroyInstance
from smartmenus.
Awesome! Thank you so much!
FYI, the dists look like they weren't built for the last commit.
from smartmenus.
Tested, works like a champ for me! Thank you again! 🍻
from smartmenus.
Np at all! This will surely be useful to others so I really appreciate your input!
I only build the dists for new versions and I have planned some other fixes too for the new release so it will wait for now (that's why I pointed you to the "src" folder).
OK, I'm closing this.. Cheers!
from smartmenus.
Related Issues (20)
- Menu Z Index question. HOT 2
- Google SEO 2022: Complete SEO Beginner's Guide
- Pay Per Click vs. Search Engine Optimization
- On-Page vs Off-Page SEO: What's the Difference?
- please add new tag
- A11y: menu toggle button needs a :focus halo HOT 2
- A11y: ESC key should dismiss expanded menu HOT 1
- Second click on link not functional on Bootstrap 5 HOT 1
- A11y: submenus should not open/close on focus HOT 2
- A11y: replace span subIndicator with button HOT 2
- eval of user controlled data? HOT 6
- please add support bootsrap 5 HOT 8
- fix warning
- A11y: add role="button" to span subIndicator HOT 1
- a11y: move the <span> subindicator outside the menu link anchor tag
- [A11Y] aria-current on active menu item HOT 1
- SmartMenus should log errors to console, not use `alert()` HOT 2
- Question about SmartMenus 2 initialization HOT 2
- Programmatically open/hide SmartMenus 2.0 HOT 1
- Open page on pages with sub-links HOT 1
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 smartmenus.