Wednesday 28 September 2016
CSS Transitions with jquery not working
Answer
I have a jquery function that adds a class to a div, to hide it
jQuery(document).ready(function() {
jQuery('.control').click(function() {
jQuery('.mob-nav').toggleClass('hide');
});
});
This works fine, but now I want to add a transition to this, using CSS. So, I used
.hide {
-webkit-transition: all 2s cubic-bezier(0.04, 0.87, 0, 0.96);
display: none;
}
But it just won't work. I tried adding the transition to the div from the beginning. Also tried it on the whole body, it doesn't do anything.
Subscribe to:
Post Comments (Atom)
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
A fair amount of the second act of The Dark Knight Rises has a class warfare plotline. This is foreshadowed in the trailers with Selina Ky...
-
I want to create an options array from a string. How can i create an array as { width : 100, height : 200 } from a string ...
-
I'm still trying to wrap my head around how the following expression results in undefined behavior: a = a++; Upon searching SO...
No comments:
Post a Comment