Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap javascript popovers not working

I've looked around and haven't been able to find anyone with an issue quite like mine.

I've also had a few people inspect my javascript/html for obvious bugs, and have squashed a few of them.

I'm trying to implement a simple javascript popover using twitter bootstrap, as shown here.

As far as I can tell, my code (here) for a button with a popover is identical to their example code (excluding the content itself), and yet it does nothing.

The button that says "Creative" on my page should have a popover similar to twitter bootstrap's example "Hover for popover" demo button.

Edit: The link to my code no longer shows the problem I was having. However, the issue was that I included the javascript source in the header as type="javascript" instead of type="text/javascript".

like image 781
fysics Avatar asked Nov 18 '25 05:11

fysics


1 Answers

Modify the code of the page L138-L146:

$(document).ready(function() {
    $("a[rel=popover]")
        .popover({
            offset: 10
        })
        .click(function(e) {
            e.preventDefault()
        })
});

UPDATE

O.o

The type of script tag is text/javascript. It's like:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
like image 198
akai Avatar answered Nov 19 '25 20:11

akai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!