javascript - Execute jQuery Popup When Page Loads? - Stack Overflow

I'm using the Reveal modal plugin by Zurb.Does anybody know how I can get the modal to execute (as

I'm using the Reveal modal plugin by Zurb.

Does anybody know how I can get the modal to execute (as in open the popup box) when my page has finished loading as opposed to when the handler is clicked?

I'd like to use it to display a simple message each time somebody opens my homepage.

I've dug through the code and tried a few things, but I'm a self confessed jQuery noob.

I was going to post the entire contents of the jQuery plugin itself, but it might just be easier to download it and take a look for yourself.

Thanks!

:)

I'm using the Reveal modal plugin by Zurb.

http://www.zurb./playground/reveal-modal-plugin

Does anybody know how I can get the modal to execute (as in open the popup box) when my page has finished loading as opposed to when the handler is clicked?

I'd like to use it to display a simple message each time somebody opens my homepage.

I've dug through the code and tried a few things, but I'm a self confessed jQuery noob.

I was going to post the entire contents of the jQuery plugin itself, but it might just be easier to download it and take a look for yourself.

Thanks!

:)

Share Improve this question asked Apr 23, 2012 at 19:47 LeelooLeeloo 1111 gold badge4 silver badges12 bronze badges 1
  • Did you try putting it in $(document).ready(...)? – jlaceda Commented Apr 23, 2012 at 19:50
Add a ment  | 

4 Answers 4

Reset to default 3
$(function() {
    $('#myModal').reveal();
});

OR

$(document).ready(function() {
    $('#myModal').reveal();
});

Couldn't you just do the following after you instantiate your modal:

$(document).ready(function() {
    // instantiate modal first
    $('#myModal').reveal();
});

Something like this should work:

<script type="text/javascript">
$(document).ready(function() {
  $('#myModal').reveal();
});
</script>

Hey had trouble getting this to work on a page using other .js libraries where JQuery NoConflict was being used -- in that case try this:

jQuery(document).ready(function($) { $('#myModal').reveal(); });

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742371134a4431289.html

相关推荐

  • javascript - Execute jQuery Popup When Page Loads? - Stack Overflow

    I'm using the Reveal modal plugin by Zurb.Does anybody know how I can get the modal to execute (as

    11小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信