Home › Forums › JavaScript › Making a rectangular transparent portion in a image using css and jquery › Reply To: Making a rectangular transparent portion in a image using css and jquery
August 10, 2013 at 2:20 pm
#146355
Participant
I don’t really understand what your last post is all about ;)
But especially when targeting mobile devices, you should prefer CSS animations/transitions to jQuery:
$( "#image" ).click(function() {$(this).addClass("i-like-to-move-it-move-it");})
#image {
transition: height 1s ease-out;
}
.i-like-to-move-it-move-it {
height: 600px;
}
If you want to do something after the transition ended, set a timeout or have a look at https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions?redirectlocale=en-US&redirectslug=CSS%2FTutorials%2FUsing_CSS_transitions#Detecting_the_completion_of_a_transition