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...
-
In K-PAX , there are two possible explanations: Prot is crazy. He is truly an alien. There are facts that indicate 1, but also 2. Examples: ...
-
Why this works? I mean, accessing the private variable. class Test { private $q = 0; public function __construct() { $this-...
-
I found this excellent tutorial on regular expressions and while I intuitively understand what "greedy", "reluctant" an...
No comments:
Post a Comment