单击按钮时如何显示自定义对话框 [英] How to display Custom Dialog box on button click

查看:57
本文介绍了单击按钮时如何显示自定义对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的自定义对话框在单击按钮时加载,但那没有发生.我正在使用此网页上的对话框.

I want my custom dialog box to load on button click but that's not happening.I am using the dialog box on this webpage.

http://jqueryui.com/dialog/#default

这是我的代码.

      function click(){
      $(function() {
           $( "#dialog" ).dialog({
            width : 250,
            height: 180,
            modal : true
            });
            });
           }


     <div>
    <button type="button" id="put" onclick="click()">Insert data</button>
     </div>

以上代码无效..请帮助...

The above code is not working..Please help...

推荐答案

校对链接
HTML:

It works fine there is prooflink
HTML:

<div id="dialog">
      <p>THIS IS DIALOG!!!</p>
    </div>

    <button id="opener">Open Dialog</button>

还有Jquery:

$(function() {
    $( "#dialog" ).dialog({
      autoOpen: false
    });

    $( "#opener" ).click(function() {
      $( "#dialog" ).dialog( "open" );
    });
  });

这篇关于单击按钮时如何显示自定义对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆