amuha07
11-16-2012, 02:16 PM
Hello dear codingforum members. im newbie in JS so i really ur need help. here is my question. Im working on simple modal project which is developed by eric martin. As it can be seen in the codes. it calls the modal screen when user clicks on demo link or button. however instead of clicking i would like to call tht modal screen automatically after certain time like 20sec later. so can i actually apply setTimeOut in tht JS code ? Thank u !!!
Regards
HTML
<div id='content'>
<div id='basic-modal'>
<input type='button' name='basic' value='DEMO' class='basic'/>
<a href='#' class='basic'>DEMO</a>
</div>
<!-- modal content -->
<div id="basic-modal-content">
<a href='asdasdasd'><img src="https:/asdasd.jpg" alt="asdasd"></a>
</div>
<div style='display:none'>
</div>
</div>
</div>
JS CODE:
jQuery(function ($) {
// Load dialog on page load
//$('#basic-modal-content').modal();
// Load dialog on click
$('#basic-modal .basic').click(function (e) {
$('#basic-modal-content').modal();
return false;
});
});
Regards
HTML
<div id='content'>
<div id='basic-modal'>
<input type='button' name='basic' value='DEMO' class='basic'/>
<a href='#' class='basic'>DEMO</a>
</div>
<!-- modal content -->
<div id="basic-modal-content">
<a href='asdasdasd'><img src="https:/asdasd.jpg" alt="asdasd"></a>
</div>
<div style='display:none'>
</div>
</div>
</div>
JS CODE:
jQuery(function ($) {
// Load dialog on page load
//$('#basic-modal-content').modal();
// Load dialog on click
$('#basic-modal .basic').click(function (e) {
$('#basic-modal-content').modal();
return false;
});
});