单击按钮时如何显示自定义对话框

编程入门 行业动态 更新时间:2024-10-28 18:35:50
本文介绍了单击按钮时如何显示自定义对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

jqueryui/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" ); }); });

更多推荐

单击按钮时如何显示自定义对话框

本文发布于:2023-08-02 17:13:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   对话框   单击   按钮

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!