HiAlert is a jQuery-based Information reminder plug-in. It supports operation success, operation failure, and Operation reminder. The hiAlert browser has excellent compatibility. It supports changing the prompt content, locating the prompt box, and configuring plug-in parameters. Bored with the warning window of IE browser, and with the fear of "Dong", it seems that there is a bad thing coming soon. The pop-up warning box (alert), confirmation dialog box (confirm), and input box (prompt) of the web page are displayed in different browsers, this article uses the hiAlert plug-in to unify the dialog style of the webpage.
The hiAlert plug-in was developed based on jquery. alerts. It includes several frequently-used prompt boxes and provides gradient prompt results to bring up the webpage layer effects. It is currently compatible with mainstream browsers.
Usage
HiAlert provides five methods to use:
1. hiAlert
HiAlert (content, title, callback );
The hiAlert method provides three parameters: content, title: Dialog Box title, callback: callback function. If no parameter exists, this parameter is left blank. For example:
HiAlert ("Welcome to helloweba.com", "prompt ");
2. hiConfirm
HiConfirm (content, title, callback );
The hiConfirm method provides three parameters: content, title: Dialog Box title, and callback: callback function. If no parameter exists, this parameter is left blank. For example:
HiConfirm ('Are you sure you want to perform this operation? ', 'Confirmation box', function (r) {hiOverAlert ('your feedback is:' + r );});
3. hiPrompt
HiPrompt (content, deinput, title, callback );
The hiConfirm method provides four parameters: content, deinput: Default Value of the input box, title: Dialog Box title, callback: callback function. If no parameter exists, this parameter is left blank. For example:
HiPrompt ('fill in: ', 'default', 'input box ', function (r) {if (r) hiOverAlert ('the content you entered is '+ r + '"');});
4. hiBox
HiBox (obj, title, w, h, submit, cancel, callback)
The hiBox method provides seven parameters: obj: the object to be opened (the object is unique), that is, the object associated with the content displayed in the dialog box, title: title, w: width, h: height: the object in the content can be set to "submit". If there is a callback, click here to return the callback action. cancel: The cancel or close button object in the dialog box. callback: callback function, for example:
HiBox ('# showbox', 'title', 400, '','', '. a_close ');
5. hiOverAlert
HiOverAlert (content, timeout );
HiOverAlert is used to display the message display effect, similar to the effect in this article. It provides two parameters: content: prompt content, timeout: prompt time. The default value is 3000, which is 3 seconds. For example:
HiOverAlert ('Operation prompt information', 1500 );
Remember to load the jQuery library, hiAlert plug-in, and the corresponding css style. You can also modify CSS to further beautify the dialog box. In addition, if you need to drag the dialog box, you need to load jquery. ui. draggable. js to learn more.
The above is all the content of this article. I hope you will like it.