How can i close the jquery modal box after 10 seconds ???
Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the <body> so that modal content scrolls instead. Clicking on the modal “backdrop” will automatically close the modal.
The close button can be added by using the simple markup with CSS class. The main container for close button is the <button> tag with . close class.
Use setTimeOut function.
//make sure you have lower case "o"
setTimeout(function(){
$(dialog).close();
}, 10000);
setTimeout(function() { // code to close the modal }, 10000);
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