jQuery UI插件自定义confirm确认框的方法_jquery

WBOY
Release: 2016-05-16 16:08:26
Original
1733 people have browsed it

本文实例讲述了jQuery UI插件自定义confirm确认框的方法。分享给大家供大家参考。具体分析如下:

这段代码通过jQuery UI自定义了一个confirm的确认对话框效果,通过html代码自定义对话框的显示界面和外观,可以自定义confirm框的按钮,本例中定义了一个confirm确认按钮和一个cancel取消按钮。

html代码

 
Are you sure about this?
Copy after login

jS代码:

$("#dialog").dialog({ autoOpen: false, modal: true, buttons : { "Confirm" : function() { alert("You have confirmed!"); }, "Cancel" : function() { $(this).dialog("close"); } } }); $("#callConfirm").on("click", function(e) { e.preventDefault(); $("#dialog").dialog("open"); });
Copy after login

希望本文所述对大家的jQuery程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!