Hi I have set a background in a div element and i want to increase the height of that div tag when I click on an anchor tag. But i want the height to be increased slowly.
You can change the duration
of the animation:
$('#element').animate({
height: '200px'
}, {
duration: 2000 // 2 seconds
});
Demo: http://jsfiddle.net/t5VYa/
Use jquery's animate function.
$('#selector').animate({
height: '500px'
}, 5000, function() {
// Animation complete.
});
where 5000 is the duration in milliseconds
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With