jquery artdialog Popup dialog Box Plugin introduction

Source: Internet
Author: User

Recently began to learn the framework of Jqueryeasyui, and now only learned the fur, for its pop-up box like the following understanding:
Import in a page

The code is as follows Copy Code
<script src= "Js/artdialog4.0.2/artdialog.source.js?skin=gray" ></script>
<script src= "Js/artdialog4.0.2/artdialog.iframetools.js" ></script>

These two JS, then you can construct the dialog window you want to test the following example:

To write a button, click the function that implements the following:

The code is as follows Copy Code

function Openpage () {
var setting={href:#,title: ' Test ', width:650,height:380,scrolling:no};
Setting.href= ' You want to open the path of the interface ';
To pass data to a page can be implemented by
Art.dialog.data (' key ', value);

Open a Window
Art. Dialog.open (setting.href,setting);

}


To implement the above function, you can open the window you want.
In the inside of an interface:

The code is as follows Copy Code

var value=art.dialog.data (' key ');

Get the value you want to pass

If you want to refresh the Father page:

The code is as follows Copy Code

var Win=art.dialog.open.origin;
Win.location.reload ();

First, use the traditional parameters

The code is as follows Copy Code

Art.dialog (content, OK, cancel)

Art.dialog (' Simple pleasing interface, powerful expressiveness, elegant inner implementation ', function () {alert (' yes ');}); Run

Second, the use of literal reference

  code is as follows copy code

Art.dialog ( Options)

var dialog = Art.dialog ({
    title: ' Welcome ',
    content: ' Welcome to use the Artdialog dialog box component! ',
    icon: ' Succeed ',
    follow:document.getElementById (' btn2 '),
     ok:function () {
        this.title (' warning '). Content (' Please note that Artdialog will be closed in two seconds! '). Lock (). Time (2);
        return false;
   }
});


The following is a section of JS that pops a form through the Artdialog and submits it via Ajaxform (the form can validate the form with a jquery validate validation control)

The code is as follows Copy Code

$ (document) . Ready (function () {
var options = {
Target: ' #output2 ',
Success:showresponse//Post-submit callback
}; $ (' #myForm '). Ajaxform (options);
var alt =null;
$ ("#addHname"). Click (function () {
Alt=art.dialog ({
Title: ' Add nickname ',
Content:document.getElementById (') G_cn '),
width:750,
button: [
{
Name: ' Save ',
Focus:true,
Callback:function () {
$ (' #myForm '). S Ubmit ();
return false;
}
},
{
Name: ' Close ',
Callback:function () {
}
}
]
};

Function Showresponse (data) {
if (Alt!=null) {
Alt.close ()
}
if (data== ' success ') {
Artdialog.alert (' save Success ');
} else{
Art.dialog.close ();
Artdialog.alert (' Save Failed ');
}
}
});

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.