我有简单的html:
<div id="discount-popup">
<h2>Discount</h2>
<form action="" method="POST">
<label for="email-input">Email</label>
<input id="email-input" type="email" name="email" value="" required /><br />
<input type="submit" name="send-discount" value="Send" />
</form>
加载后5s后jquery启动页面:
if ($('#discount-popup').length) {
setTimeout(function () {
$.fancybox({
autoSize: false,
height: 'auto',
minHeight: 385,
width: 650,
href: '/index/discount-popup',
type: 'iframe'
});
}, 5000);
}