23rd rounds of Bootstrap3.0 Learning (JavaScript plug-in-warning box)

Source: Internet
Author: User
Tags rounds

Before reading, you can also go to the Bootstrap3.0 getting started learning series navigation to view the http://www.cnblogs.com/aehyok/p/3404867.html

This article mainly describes the JavaScript plug-in-warning box.

Case

You can use this plug-in to disable all warning boxes.

      <div id=  =>        <button id= type= = data-dismiss= aria-hidden=>&times;</button>        <strong>Holy guacamole!</strong> Best check yo self, you      </div> 

Another small example

      <div =>        <button type= = data-dismiss= aria-hidden=>&times;</button>        

 

You can use the data-dismiss attribute to disable the warning box function. No JavaScript code is required. You only need to set the close buttondata-dismiss="alert"The alarm box is automatically disabled.

Usage

If you enable the warning box function in JavaScript:

Let's modify the first simple example.

      <div id=  =>        <button id= type= = onclick= aria-hidden=>&times;</button>        <strong>Holy guacamole!</strong> Best check yo self, you      </div>  

We removed the data-dismiss attribute of the close button and added an onclick event, that is, the event in the close Alert box.

Let's take a look at how to close the Alert box through JavaScript.

 <script type=>).alert(</script>

Disable all warning boxes. If you want to render the animation when the warning box is closed, make sure that you have added.fadeAnd.in.

Event

The warning box in Bootstrap exposes a group of events that allow you to listen.

  <script type=>).bind(</script>

After the above Code is added, When you click the close button, the code in the function is executed first, and then the warning box is closed.

I feel more and more familiar with myself. The time for completing this warning box is obviously shortened. It seems that I have learned it too.

This article has been updated to the Bootstrap3.0 getting started learning series navigation http://www.cnblogs.com/aehyok/p/3404867.html

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.