Hi, I am working on some website , i have used jQuery UI , for pop-up dialog .
I want to close that after 10sec, I have used fadOut 10000 ms but its slowly fades.
View the source code and please help me in this.
Hi, I am working on some website , i have used jQuery UI , for pop-up dialog .
I want to close that after 10sec, I have used fadOut 10000 ms but its slowly fades.
View the source code and please help me in this.
There is a javascript function that allows you to carry out an action after a timeout:
setTimeout('$("#dialog").hide()', 10000);
Usually you're better off passing a function rather than the text to eval()
setTimeout(hideDialog, 10000);
function hideDialog() { $('#dialog').hide(); }
Or, if you want just one line:
setTimeout(function() { $('#dialog').hide(); }, 10000);
Keith's version is a good approach, another, maybe more hacky way, of doing it is this:
$("#modal").animate({opacity:1}, 10000, function() {
$(this).fadeOut();
});
This way, you can link up everything that needs to be done to the modal in one line...