I have a function that executes to slide open a couple divs to reveal the content behind. There is a button that when clicked activates the function to reveal said content. I’m trying to figure out how to execute that function automatically if the button isn’t clicked on after 7 seconds. Any help would be much appreciated.
Here’s what I’ve got.
$(document).ready(function() {
$(".button").click(function(){
$(this).fadeOut('slow');
$(".leftside").animate({width:'60px'}, 500 );
$(".rightside").animate({width:'60px'},500 );
});
});
Add a timer:
And clear it in your button click:
Full code: