Bootstrap Popup box and warning box plugin

Source: Internet
Author: User

A Pop-up box

A popup box that clicks on an element pops up a container containing the title and content.

Basic usage

<class= "btn btn-lg btn-danger"     type= "button"      Data-toggle= "PopOver"     title= "pop-up box"     data-content= " This is a popup box plugin ">  Click the popup/Hide popup box </button>

<script type= "Text/javascript" >$ (' button '). PopOver (); </script>

As follows:

The popup plugin has a number of properties to configure the display of hints, as follows:

$ (' button '). PopOver ({container: ' body ', viewport: {selector: ' #view ', Padding:10,}});

There are four ways to do this through JavaScript.

Show

$ (' button '). PopOver (' show ');

<DivID= "View"><ButtonID= "B"class= "btn btn-lg btn-danger"type= "button"Data-toggle= "PopOver"title= "Popup box"data-content= "This is a popup box plugin"Data-trigger= "PopOver">Click the popup/Hide pop-up box</Button></Div><ButtonID= "BTN">Button</Button>
<script type= "Text/javascript" >$ (' #b '). PopOver ({        viewport:{                selector:' #view ' ,                padding:ten,            }    }); $ (' #btn '). On (' click ',function() {        $(' #b '). PopOver (' show ');    }); </script>

As follows:

Click the button to eject the right content

Hide

Invert Show and hide

Hide and Destroy

$ (' button '). PopOver (' destroy ');

There are two types of events in the Popover plugin.

Events, other similarities

function () {alert (' triggers when the Show method is called! ‘); });

Two Warning Box

The warning box is the message box for the hour of the click.

Basic example

<Divclass= "Alert Alert-warning">  <Buttonclass= "Close"type= "button"Data-dismiss= "Alert"> <span>&times;</span> </Button>  <P>Warning: Your browser is not supported!</P></Div>

Add a fade effect

<class= "Alert alert-warning fade in">

If you use JavaScript, you can replace data-dismiss= "alert"

JavaScript methods

function () {$ (' #alert '). Alert (' Close ');})

There are four types of events in the Alert plugin.

Events, other similarities

function () {alert (' Called when the Close method is triggered! ‘); });

Bootstrap Popup box and warning box plugin

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.