A superb message prompting jQuery plug-in-Noty

Source: Internet
Author: User

Date: 2012-8-20 Source: GBin1.com

Online Demo local download
We have introduced a messaging framework based on jQuery, backbone. js, and underscore. js. Today we will introduce another jQuery messaging plug-in-Noty. It helps us quickly create, warn, prompt, and error message boxes. You must have used the default alert ('..') code. You can use Nody to create a message prompt with more powerful functions. I hope you will like it!
Main features
Built-in alert, warning, error, success, information, and confirm dialog boxes
Supports TOPIC Development
Fully customizable
Allows animation Customization
Different callback methods (onShow, afterShow, onClose, and afterClose) are supported.
How to Use
You can import the corresponding class library as follows:
<Script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script>
 
<! -- Noty -->
<Script type = "text/javascript" src = "js/jquery. noty. js"> </script>
 
<! -- Layouts -->
<Script type = "text/javascript" src = "js/layouts/bottom. js"> </script>
<Script type = "text/javascript" src = "js/layouts/bottings enter. js"> </script>
<Script type = "text/javascript" src = "js/layouts/bottomLeft. js"> </script>
<Script type = "text/javascript" src = "js/layouts/bottomRight. js"> </script>
<Script type = "text/javascript" src = "js/layouts/center. js"> </script>
<Script type = "text/javascript" src = "js/layouts/centerLeft. js"> </script>
<Script type = "text/javascript" src = "js/layouts/centerRight. js"> </script>
<Script type = "text/javascript" src = "js/layouts/inline. js"> </script>
<Script type = "text/javascript" src = "js/layouts/top. js"> </script>
<Script type = "text/javascript" src = "js/layouts/topCenter. js"> </script>
<Script type = "text/javascript" src = "js/layouts/topLeft. js"> </script>
<Script type = "text/javascript" src = "js/layouts/topRight. js"> </script>

<! -- Themes -->
<Script type = "text/javascript" src = "js/themes/default. js"> </script>
Note that the above includes the noty class library, layout code and theme code. You can reference it based on your own needs. This effectively reduces the js code size.
It is very easy to call noty, just use the following code:
Var n = noty ({
Text: 'Do you want to continue? ',
Type: 'alert ',
DismissQueue: true,
Layout: 'center ',
Theme: 'default ',
Buttons :[
{AddClass: 'btn btn-primary ', text:' OK ', onClick: function ($ noty ){
$ Noty. close ();
Noty ({dismissQueue: true, force: true, layout: layout, theme: 'default', text: 'You clicked "OK" button ', type: 'success '});
}
},
{AddClass: 'btn btn-danger ', text: 'cancel', onClick: function ($ noty ){
$ Noty. close ();
Noty ({dismissQueue: true, force: true, layout: layout, theme: 'default', text: 'You clicked "Cancel" button ', type: 'error '});
}
}
]
});
The above Code creates a confirmation box. When the page is loaded, a confirmation box is automatically generated. The location is in the middle of the page, which is controlled by the layout option.
Source: a great message prompting jQuery plug-in-Noty
 

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.