Reputation: 3815
This is my js code. Actually I want to set time to apply this css. I tried using setTimeout but not working. How to do using setTimeout or anything else. Please help. Thank you
$(document).ready(function() {
$(".front").click(function() {
$(".flip-container").css({
"height": "0px"
});
});
});
Upvotes: 0
Views: 39
Reputation: 115222
Use setTimeout()
as follows
$(document).ready(function() {
$(".front").click(function() {
setTimeout(function() {
$(".flip-container").css({
"height": "0px"
});
}, 1000);
});
});
you can also do it with some animation using animate()
method
$(document).ready(function() {
$(".front").click(function() {
$(".flip-container").animate({
"height": "0px"
}, 1000);
});
});
Upvotes: 2