How do I use popover from Twitter Bootstrap to display an image?

后端 未结 5 1854
失恋的感觉
失恋的感觉 2020-12-22 17:45

The canonical example for Twitter Bootstrap\'s popover feature is sort of a tooltip on steroids with a title.

HTML:



        
5条回答
  •  别那么骄傲
    2020-12-22 18:13

    Here I have an example of Bootstrap 3 popover showing an image with the tittle above it when the mouse hovers over some text. I've put in some inline styling that you may want to take out or change.....

    This also works pretty well on mobile devices because the image will popup on the first tap and the link will open on the second. html:

    Template Preview 1
    Template Preview 2
    Template Preview 3

    js:

    $('.preview').popover({
        'trigger':'hover',
        'html':true,
        'content':function(){
            return "";
        }
    });
    

    https://jsfiddle.net/pepsimax_uk/myk38781/3/

提交回复
热议问题