开发者

Trying to show a jqModal dialog on $(document).ready

开发者 https://www.devze.com 2023-03-18 17:36 出处:网络
I\'m adapting a jqModal script to launch in an onLoad fashion using the $(document).ready method, but I\'m getting something wrong somewhere. I\'m new to stackoverflow, and I smell brains all over thi

I'm adapting a jqModal script to launch in an onLoad fashion using the $(document).ready method, but I'm getting something wrong somewhere. I'm new to stackoverflow, and I smell brains all over this place. (Wish I was one of them.) The full page code (relatively short) can be seen by viewing the source of this URL: ht开发者_如何学JAVAtp://www.caycecookbook.com/pop_ups/jqm_onDocReady/jqm_docReady.html

The short end of the code looks like this:

<script type="text/javascript"> 
    $(document).ready(function() {
        $('#rename').jqm();
    });
</script> 
<!-- POP-UP DIV -->
<DIV class="jqmWindow" id="rename" style="padding:18px 0px 12px 0px;">
    <TABLE align="center" width="500" border="0" cellspacing="0" cellpadding="0" bgcolor="#7777777">
        <TR><TD align="center"><P style="margin: 12px 12px 12px 12px;">
<img src="images/hey_there.jpg" width="504" height="360"  border="0"></p></td></tr>
        <TR><TD align="center" valign="middle">
            <P style="margin:6px 0px 0px 0px;">
                <a href="#" class="jqmClose" style="text-decoration:none; color:#ffffff;; 
font-family: arial, helvetica, verdana, sans-serif; font-size:12px; 
font-weight:bold;">Close</a>
            </p>
        </td></tr>
    </table>
</div>

Any help on this would be much appreciated.


You never call jqmShow to show the dialog. You only initialize its parameters with jqm.

Ref: http://dev.iceburg.net/jquery/jqModal/#how

Update

Here is the requested code example:

<script type="text/javascript"> 
    $(document).ready(function() {
        $('#rename').jqm();
        $('#rename').jqmShow(); // This is the line you need to add.
    });
</script> 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号