I'm developing a website using bootstrap and its responsive JS+CSS.
At the top of the page I have a fixed navigation bar where an "expand menu" button is shown in case the viewport is too tight. This button does its magic with an animation (a CSS3 one I think) and I'm happy with it, but I would like to do something more (toggle classes with jquery) each time the animation finishes (both the open animation and the close one).
I was thinking about a javascript listener (even better by defining it thanks to jquery .on function), but I really don't know what event I should listen to!
Any ideas?
UPDATE
I've fond out that by listening to this event on the object I wanna control almost does the job well:
$("#main-navbar .nav-collapse").on("transitionend", function(event){
console.log("end of the animation");
}
the only problem is that it messes bootstrap animations up on that object: the first time it works, but wen I want to close the expanded navbar, nothing happens (it seems that my listener overrides the bootstrap ones. quite weird, huh?)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…