JQuery -- dialog Box plug-in -- dialog, jquery ---- dialog

Source: Internet
Author: User

JQuery -- dialog Box plug-in -- dialog, jquery ---- dialog
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> dialog box plug-in </title>
<Link href = "http://www.imooc.com/data/jquery-ui.css" rel = "stylesheet" type = "text/css"/>
<Link href = "style.css" rel = "stylesheet" type = "text/css"/>
<Script src = "http://www.imooc.com/data/jquery-1.8.2.min.js" type = "text/javascript"> </script>
<Script src = "http://www.imooc.com/data/jquery-ui-1.9.2.min.js" type = "text/javascript"> </script>
</Head>

<Body>
<Div id = "divtest">
<Div class = "content">
<Span id = "spnName" class = "fl"> Zhang San </span>
<Input id = "btnDelete" type = "button" value = "delete" class = "fr"/>
</Div>
<Div id = 'Dialog-modal'> </div>
</Div>

<Script type = "text/javascript">
$ (Function (){
$ ("# BtnDelete"). bind ("click", function () {// ask button event
If ($ ("# spnName" ).html ()! = Null) {// if the object is not empty
Sys_Confirm ("Do you really want to delete this record? ");
Return false;
}
});
});
Function sys_Confirm (content) {// The Query Information Window is displayed.
$ ("# Dialog-modal"). dialog ({
Height: 140,
Modal: true,
Title: 'System prompt ',
Hide: 'slide ',
Buttons :{
'OK': function (){
$ ("# SpnName"). remove ();
$ (This). dialog ("close ");
},
'Cancel': function (){
$ (This). dialog ("close ");
}
},
Open: function (event, ui ){
Certificate (this).html ("");
$ (This). append ("<p>" + content + "</p> ");
}
});
}
</Script>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.