简体   繁体   中英

How to load jQm modal on page load?

Hi I am using jQm Window to load modal window.

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

i am trying to

jqmShow
    Show jqModal element(s).

    $('#dialog').jqmShow();
    $('.dialogs').jqmShow();

but it throws some JS error,

but it does not load on the page load, please guide me for the same.

TIA

Seriouly why do you have to make life complicated for yourself? Just put a div on your page that is hidden that floats in the center like this

<div style="position: absolute; top:50%; left:50%;" hidden="true" id="Messagee">
//Your Message or Html Here
</div>

and then when you need to show it have a function that does

$("#Message").html("<p>My Message</p>"); 
$("#Message").show(); 

You don't need a crazy javascript module that does modals, you can really make your life easy. Oh and if you want some nice effects use the $("#Message").fadeIn(500); instead!

I got the answer , it was quite easy using jqmShow();

$('#alert-box').jqm({ajax: 'alert-note.html' , modal:true});
$('#alert-box').jqmShow();

:)

thank you all for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM