Le Code:
$j(document).bind('click', function() {
$j("#test").css({ bottom:0px })
});
Looking in the inspector, even when the element is at the top of the page, it still says it’s bottom value is 0.
Maybe I need to play the animation in reverse somehow? or play a different animation? (Using Bottom %, rather than top %)
As you were thinking you can make a second keyframe block to reset it back to the bottom:
then have your jQuery change the animation name:
jsfiddle
When using
-webkit-animation-fill-mode: forwards;forwards will maintain the last keyframe styles, sotop:0%is still set which is whybottom:0was having no effectfor fun…switch between animation’s each click
jsfiddle