bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Javascript plugin declaration

Open liamweiland opened this issue 14 years ago • 5 comments

Hello everyone! I am a javascript newbie, but I do know a fair amount about html and css. How do you declare the javascript plugins on the html document? Any help would be greatly appreciated! In particular the dropdown menus. I have been having a lot of trouble with them.

liamweiland avatar Feb 12 '12 06:02 liamweiland

Here's an example using the Tooltip plugin.

`

Tooltip

Bootstrap Tooltip Example

Hover over me!

`

jonlabelle avatar Feb 12 '12 15:02 jonlabelle

Thanks Jon! I will give that a shot.

liamweiland avatar Feb 12 '12 16:02 liamweiland

I tried this and it didn't work. It seems that none of the plugins are working.

liamweiland avatar Feb 12 '12 17:02 liamweiland

<script type="text/javascript">
    $(document).ready(function() {
        $("a[rel=tooltip]").tooltip({
            placement: "bottom"
        })
    });
</script>

Add that in your header, and modify the placement.

WittyPleb avatar Feb 12 '12 18:02 WittyPleb

For most plugins, you don't need to do anything—just add the JS includes along with the latest version of jQuery and you'll be set. For tooltips and popovers, however, you do need to initialize them.

@jonlabelle's example works fine for me. If you need more help, try emailing the mailing list.

mdo avatar Feb 12 '12 19:02 mdo