简体   繁体   中英

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".

Modify the code of the page L138-L146:

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

UPDATE

Oo

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM