Iframe extension code of jquery. boxy plug-in _ jquery

Source: Internet
Author: User
Iframe extension of jquery. boxy plug-in The Code is as follows:


/*


The w, h, and src attributes remain unchanged for the Boxy attribute.
QBox. Close (); Close the current window
QBox. iFSrc ({}); changing the properties of the current window and adding the w, h, and src attributes to the Boxy attribute
*/

// Boxy Extension
JQuery. fn. qbox = function (options ){
Var node = this. get (0). nodeName. toLowerCase ();
Var self = this;
If (node = 'A '){
$ (This). attr ('onclick', ''). unbind ('click'). click (function () {return false ;});
Options = $. extend (options | {}, {src: this. get (0 ). getAttribute ('href '), beforeUnload: function () {$ (self ). unbind ('click '). click (function () {return $ (this ). qbox (options );});}});
}
QBox. iFLoad (options );
Return false;
}
Var qBox = function (){};
JQuery. extend (qBox ,{
ADgs: [],
IFrame: function (op ){
Op = jQuery. extend ({title: 'hint', w: 320, h: 200, src: 'about: blank ', modal: false, fixed: false, unloadOnHide: true }, op), fm = parseInt (Math. random () x (1000*987 ));//
Var dialog = new Boxy ("Loading. Please wait ....", Op );

JQuery ("# _" + fm). load (function (){
Dialog. resize (op. w, op. h, function (){});
JQuery ("# ld" + fm). remove ();
JQuery ("# _" +fm).css ({'padding': '15px ', 'display ':''});
});
QBox. aDgs. push (dialog );
Return false;
},
Close: function (){
QBox. aDgs [qBox. aDgs. length-1]. hide ();
Return false
},
IFSrc: function (op ){
Op = jQuery. extend ({w: 320, h: 200, src: 'about: blank '}, op );
QBox. aDgs [qBox. aDgs. length-1]. getContent (). attr ("src", "about: blank ");
QBox. aDgs [qBox. aDgs. length-1]. setTitle (op. t );
QBox. aDgs [qBox. aDgs. length-1]. tween (op. w, op. h, function () {qBox. aDgs [qBox. aDgs. length-1]. getContent (). attr ("src", op.src).css ({width: op. w, height: op. h });});
Return false;
},
IFLoad: function (options ){
Var sr = jQuery (this). attr ("href ");
Var op = jQuery. extend ({src: sr}, options );
QBox. iFrame (op );
Return false;
}
});


Source: cn795.cnblogs.com
Related Article

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.