Bubble pop-up Bootstrap-configuration and flexible application of popover

Source: Internet
Author: User

<SCRIPT src = "/assets/Addons/Bootstrap-select/bootstrap-select.min.js"> </SCRIPT>

<SCRIPT type = "text/JavaScript">
// Bubble pop-up
$ (Function (){
$ (". Popover-Hover"). popover ({
Placement: 'left ',
Trigger: 'hover ',
Title: 'subscription content delay display ',
});
});
</SCRIPT>

 

 

Bootstrap-popover configuration and flexible application

First, list the configuration parameters:

1. Whether the animation is set to true or false.

2. Position of the prompt displayed in placement 'right'/'left'/top/bottom/function () {return 'right '}

3. Target selector object

4. Trigger 'hover '/'click'... trigger Method

5. If the data-original-title attribute is not specified for the Title element, use this default value.

6. If the content element does not specify the data-content attribute, use this default value.

7. Delay display and hide time 20/{Show: 200, hide: 300}

 

Next, let's list the problems we encounter during daily development:

1. What should I do if I want to trigger an event with a mouse click by default?

$(‘a‘).popover({    trigger : ‘click‘});

 

2. What if I want to click a non-target object to close the prompt layer?

Note: Each prompt generates a div container whose class is popover. Therefore, you only need to bind a click event to the body to destroy the DIV whose class is pover. It is worth noting that the bubble of the Click Event of the target object should be canceled.

(function(){    $body.find(‘.popovers‘).each(function(){        $(this).click(function(e){            $(‘.popover‘).remove();            e.preventDefault();            return false;        });        $(this).popover({            trigger : ‘click‘        });    });    $body.click(function(){        $(‘.popover‘).remove();    });})();

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.