Trigger a pop up modal div after 1 minute
Ive never used this site but really need some help with this one.
I have this page http://bit.ly/d6WfDG and in the 开发者_StackOverflowtop left corner if you click learn more you will see my pop up div
So i need to trigger this event but after 1 minute instead of using the link learn more.
Also in the same breathe is it possible to validate and submit the form in request callback without closing the div???
please please help im still learning. ;)
you could use setTimeout:
setTimeout(10000, function() {
$('#dialog').dialog('open');
});
In response to validating, it depends on how you set up the dialog, as you could do some validation on the click events of the buttons that you created:
$('#dialog').dialog({
autoOpen: false,
buttons: {
"Confirm" : function() {
if($('#username').val() == '') {
$('#username').addClass('error');
//Do some more things like inserting an error message
return false;
}
}
}
});
精彩评论