Jquery.boxy Pop-up (Auto Hide/auto jump after n seconds) _jquery

Source: Internet
Author: User
Write some articles before using the boxy pop-up (see Jquery.boxy Basics) today is mainly in the solution of a need, feel that it is worth recording down, so write another, the main function is, in the pop-up dialog box, after every n seconds automatically hidden, there is automatic jump!

effect as shown

and the encapsulated code is as follows
Copy Code code as follows:

Boxy dialog box extension
var boxy_extensions = {
Options: {
Title: ' Art Bar hint ',
Closetext: ' x '
},
Hide after n seconds after popup
Alertdelayfun:function (info, timer, options) {
Options = $.extend (this.options, Options | | {});
New Boxy ("<div style= ' padding-left:50px;padding-right:50px;text-align:center;font-size:14px; > "+ info + </div>", $.extend ({behaviours:function () {
SetTimeout (' $ ('. Boxy-wrapper '). Hide (); ', Timer ';
}
}, Options));
},
After pop-up, auto jump
Alerthreffun:function (info, href, options) {
Options = $.extend (this.options, Options | | {});
New Boxy ("<div style= ' padding-left:50px;padding-right:50px;text-align:center;font-size:14px; > "+ info + </div>", $.extend ({behaviours:function () {
location.href = href;
}
}, Options));
}
}

Because the options attribute is public, it is presented, and each method has its own options, and if you pass the options when calling your own method, the $.extend will

With the contents of the options attribute in the class to merge (covering the key value, extend the new key value), it seems to write JS should also follow the principle of object-oriented, hehe!

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.