Jquery message plug-in tooltip alarm prompt application example

Source: Internet
Author: User

Writing reason:

As a prompt box, jquery has a messagebox control, that is, a pop-up prompt box. However, if this control is not used for confirmation, you need to click "OK" for warning, message, or failure prompts, sometimes this operation is annoying (although you can set timeout, it will automatically disappear ).

Control requirements:

Now you need a simple message prompt control without confirmation.

1. The prompt box can be slide from the top or bottom.

2. You can set the slide time, content stay time, and slide time.

PS: relatively simple controls

The effect is as follows:

Compilation process:

1. If no document is available, we recommend that you write the definition of parameters that can be passed in at the beginning of the control.


Var defaults = {
ZIndex: 9999,
FadeInTimeOut: 1, // second
ContentTimeOut: 3,
FadeOutTimeOut: 1,
Position: "top" // show position top or bottom
};

In this way, the user is very clear about what he can set, even if there is no document, can play happily.

2. Considering browser compatibility

Because the prompt box of the control is fixed at the bottom or top, the position: fixed issue is inevitable.

IE6 IE7 IE8 fixed positioning element position: absolute is set, so location computing also needs to change.

3. Implementation of sliding effect

Slide, content stay, and slide.

The specific implementation is not described here. The Source Code link will be provided at the end.

PS: The most important thing is the above three.

Summary:

1. In the era highlighted by the user experience, this control was also made to give users a better experience.

2. When doing something (encoding), I always want to know if it can be used in a universal way, and controls and frameworks are nothing more than universal.

DEMO:

$ .MessageTip.info ({
Message: "I am sending a message .......",
FadeInTimeOut: 1, // enter the number of seconds
ContentTimeOut: 3, // content stay seconds
FadeOutTimeOut: 1, /// slip out seconds });

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.