Can I add a "Like" Button in Twitter's Bootstrap Popover?
I have a button which launches a popover when clicked (just like the live demo here: http://twitter.github.com/bootstrap/javascript.html#popovers)
Now I would like a simple like button in the content field of the popover. Is that possible? Currently, the popover does display only the link as text "http://test.com"
Currently:
<a href="#" id="example" rel="popover" data-content="http://test.com" data-original-title="Like"><img src="img/specialbutton.png"></a>
I am not completly sure what you mean with a like-button. In order to place a button with the anchortext "like" and a link to "http://test.com" on the popover :
1 Remove all data-xxx references from your <a>
-tag
<a href="#" id="example" rel="popover"><img src="img/specialbutton.png"></a>
2 invoke the popover like this
$('#example').popover({
placement: 'right',
title: 'Like this website?',
html: true,
content: '<button class="btn"><a href="http://test.com">Like</a></button>'
});
You can place many types of HTML-tags in content
, maybe you want a gruop of buttons to various social media? If you want to add a facebook-button you must follow the guidelines for this and insert the code generated from there in content
上一篇: 生成单页HTML JavaDoc