jquery popup Layer Effect Instance code (1/2)

Source: Internet
Author: User

JS Code

/* Bounce definition hidden box
<div id= "league" style= "Display:none" >
<button class= "Close" >close</button>
</div>
Q.showpanel ("League", function (panel, container) {
Container.find (". Close"). Click (function () {
Panel.close ();
}
);
*/
Q.showpanel = function (Containerid, registereventcallback) {
var container = $ ("#" + Containerid);
var height = container.height ();
var width = container.width ();
container = Container.clone (true);
var options = {height:height, width:width, Container:container};
var panel = new Q.panel ();
Registereventcallback (Panel, container);
Panel.show (options);
};
/* pop-up window, loading form HTML fragment from URL * *
Q.openwindow = function (URL, data, registereventcallback) {
$.get (URL, data, function (HTML) {
var Paneldiv = $ (HTML);
Paneldiv.hide ();
$ (document.body). Append (Paneldiv);
var options = {height:paneldiv.height (), Width:paneldiv.width (), container:paneldiv};
var panel = new Q.panel ();
Registereventcallback (panel, paneldiv);
Panel.show (options);
});
}
/* Prompt box, 3 seconds to automatically fade * *
Q.tips tutorial = function (msg) {
var html = ' <div class= ' gu_layer w330 ' > ' +
' <div class= ' gu_layer_main ' > ' +
' ' <p class= ' gu_layer_txt ' > ' + msg + ' </p> ' +
' <div class= ' gu_layer_btn ' ></div> ' +
' </div></div> '
var container = $ (HTML);
Container.hide ();
$ (document.body). Append (container);
var panel = new Q.panel ();
Panel.show ({container:container, height:container.height (), Width:container.width (), speed:500});
settimeout (function () {panel.close (500);}, 3000);
};
/* Prompt Box * *
Q.alert = function (msg) {
var html = ' <div class= ' gu_layer w330 ' > ' +
' <div class= ' gu_layer_main ' > ' +
"' <p class= ' gu_layer_txt ' > ' + msg + ' </p> ' +
' <div class= ' gu_layer_btn ' ><a class= ' btn_org ' href= ' ' > OK </a></div> ' +
' </div></div> '
var container = $ (HTML);
Container.hide ();
$ (document.body). Append (container);
var panel = new Q.panel ();
Container.find (". Btn_tit_close"). Click (function () {
Panel.close ();
return false;
});
Container.find (". btn_org"). Click (function () {
Panel.close ();
return false;
});
Panel.show ({container:container, height:container.height (), Width:container.width ()});
};
/* Confirm box Cancel callback is optional * *
q.confirm = function (title, MSG, yes, cancel) {
var html = ' <div class= ' gu_layer w330 ' > ' +
' <div class= ' gu_layer_main ' > ' +
"' <p class= ' gu_layer_txt ' > ' + msg + ' </p> ' +
' <div class= ' gu_layer_btn "><a class=" btn_org "href=" "> OK </a><a class=" Btn_gray "" > Cancel </a></div> ' +
' </div></div> '
var container = $ (HTML);
Container.hide ();
$ (document.body). Append (container);
var panel = new Q.panel ();
Container.find (". Btn_tit_close"). Click (function () {
Panel.close ();
return false;
});
Container.find (". Btn_gray"). Click (function () {
if (cancel)
Cancel ();
Panel.close ();
return false;
});
Container.find (". btn_org"). Click (function () {
if (yes)
Yes ();
Panel.close ();
return false;
});
Panel.show ({container:container, height:container.height (), Width:container.width ()});
};

Home 1 2 last page

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.