Search code examples
twitter-bootstrappopover

How to only include Bootstrap Popover functionality?


how can I only include the popover functionality from Twitter Bootstrap? I only want to use popovers in my app and do not want to include any of the other features of Bootstrap.

I've included the following: src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"

However none of the popover functions/methods are executed/recognized in my app when I test.

Any help would be much appreciated.


Solution

  • You'll need to include jquery.js and bootstrap.js, you can skip bootstrap.css but your popover will need to be styled. You can use your browsers dev tools to see the popover classes that need to be styled.

    HTML:

    <p>Popover Demo</p>
    
    <a href="#" id="example" rel="popover"
       data-content="This is the body of Popover"
       data-original-title="Demo">pop
    </a>
    

    JS:

    $(function () {
        $('#example').popover();
    });
    

    CODEPEN DEMO