- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Bootstrap Toggle Doesn't Re-Collapse
I’m trying to fix the toggle button from the mobile view in my theme, it doesn’t re-collapse. I guess it should be a CSS error because the Javascript console doesn’t throw any error.
Not a CSS
issue, somehow the in
class isn’t removed from the #navbar
when hitting the button again, so it is javascript. Has to be something else then Bootstrap also, for that is working fine in this reduced test case with just the default bootstrap.js
. What I would do is:
Looking at the source code, it seems there is also some scripts added in twice.
Moved to JS Section
Thank you @Atelierbram, it was caused because jQuery was loading two times but I didn’t know why, so I used this plugin (https://wordpress.org/plugins/wp-jquery-plus/) to load it from Google CDN and now it is working fine.
It had to be something like that, anyway, If I am not mistaken I think it’s expected from WordPress plugin authors to use (“enqueue”) the version of jQuery that comes with WordPress.
There is also this Minqueque plugin that is supposed to be good, but haven’t had a chance to try out yet. When using that one for all the (conditional) loading of scripts, you maybe don’t need that other “WP-jQuery-Plus” plugin. Just a thought …
Just tried and works perfectly. Good thought, thanks.