Pure JavaScript implements message hints for Notie.js plug-ins based on _javascript tips

Source: Internet
Author: User

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.

Related Article

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.