jquery modal dialog onclick?

前端 未结 3 847
我寻月下人不归
我寻月下人不归 2021-02-20 13:39

I want this:

http://jqueryui.com/demos/dialog/#modal-message

to happend when you click on ClickMe.

how to do this?



        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 14:08

    Using the jQuery UI Dialog, in $(document).ready(...) do:

    $('div.thedialog').dialog({ autoOpen: false })
    

    to create the dialog and

    $('#thelink').click(function(){ $('div.thedialog').dialog('open'); });
    

    to open it.

提交回复
热议问题