This article introduces the pure JavaScript implementation message hint effect is a notie.js plug-in implementation can be made alert box, confirmation box and with input message box, shared for everyone to reference, the specific content as follows
Effect Chart:
Code to implement:
HTML code:
<br><br><br><br><br><br>
<article class= "ZZSC" >
<div class= "Div-ext" >
<div class= "Div-int" >
<span>test notie with these buttons:</span>
< br>
<button onclick= "success ();" >Success</button>
<button onclick= "Warning ();" >Warning</button>
<button onclick= "error ();" >Error</button><br>
<button onclick= "info ();" >Information</button>
<button onclick= "confirm ();" >Confirm</button>
<button onclick= "input ();" >Input</button>
<br>
</div>
</div>
</article>
JS Code:
Function success () {
Notie.alert (1, ' success! ', 2);
}
Function Warning () {
Notie.alert (2, ' warning<br><b>with</b><br><i>html</i ><br><u>included.</u> ', 2);
}
Function error () {
Notie.alert (3, ' Error. ', 2);
}
function info () {
Notie.alert (4, ' information. ', 2);
}
function confirm () {
notie.confirm (' Are you sure for your want to do that?<br><b>that\ ' a bold move...</b& gt; ', ' Yes ', ' Cancel ', function () {
Notie.alert (1, ' Good choice! ', 2);
}
function input () {
notie.input (' Please enter your e-mail address: ', ' Submit ', ' Cancel ', ' email ', ' name@example.com ', function (value_entered) {
Notie.alert (1, ' you entered: ' + value_entered, 2);
});
}
I hope this article will help you learn about JavaScript programming.