jquery modal dialog onclick?

前端 未结 3 773
我寻月下人不归
我寻月下人不归 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:10

    @Azzyh I thing that @Rune means that you have to make a script for it.

    You put this into the tag of your html

     
    

    (also you have to have the JQuery-ui script and JQuery script too linked to your page with the as sawn above (ex ) <- in witch case he load the script of the internet).

    Where script.js is the script file ( in the same folder as the html file ).

    Now, in the script.js you write

    $(document).ready(function(){
       $('div.thedialog').dialog({ autoOpen: false })
       $('#thelink').click(function(){ $('div.thedialog').dialog('open'); });
    });
    

    PS: Read this book if you like to learn how to do All that cool stuff you see on the internet.

提交回复
热议问题