-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class "in" is not removed from collapsed menu when screen became bigger #13245
Comments
Duplicate of #11653, please search next time. |
However, that issue was punted 3 months ago. Perhaps we can actually deal with it now. |
Solved with this code: $(window).on('resize', function () {
if (window.innerWidth > 768) $('.navbar-collapse').removeClass('in')
}) customized from #11653 hope to see this kind of code in standard bootstrap soon, this is useful. |
@cvrebert i'd rather not add code like that to the dropdown plugin… maybe a good candidate for docs? $(window).on('resize', function () {
if (window.innerWidth > 768) $('.navbar-collapse').removeClass('in')
}) |
or we could just add to the bottom of the collapse plugin with a comment…feels kinda jank tho |
No, I think it's a good candidate for actually including in the plugin. 😀 We just need to un-hardcode the width and maybe put it inside a method if you want it to be opt-in. Having the navbar be broken like this feels jank. |
Yeah, it'd be awesome to have the collapse plugin use a data attribute for the collapse. I don't think that's something we can just roll into v3.x though, no? |
Hmm, why not? As long as we fall back to the current lack-of-behavior when the attribute is absent, seems like it should be fine. |
Punting to v4 because I want to rethink a bunch of this and complicating the plugin more sounds like a bad idea to me right now. Also I think the JS and CSS to make the current behavior and the new stuff happen would probably be a shit show. |
Similar: google/web-starter-kit#79 |
In this link http://jsfiddle.net/tZXTv/
1 -
has two classes: collapse navbar-collapse2 -
the class "collapse" has his position changed, and a class "in" is add3 - If resize the screem without click on this
this classes "navbar-collapse collapse in" aren't change
and why? because if i want to style the collapsed menu i need some class of reference, the only one is "in", and if this class is not removed i dont know what I can use a reference to style.
The text was updated successfully, but these errors were encountered: