Can I add a Like button to Twitter Bootstrap Popover?

I have a button that launches a popover when clicked (same as the demo: http://twitter.github.com/bootstrap/javascript.html#popovers )

Now I need a simple button in the popover content field. Is it possible? Currently, popover only displays 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> 
+7
source share
1 answer

I'm not quite sure what you mean with a similar button. To place a button with a "like" link and a link to "http://test.com" on a popover:

1 Remove all data-xxx links from <a> -tag

 <a href="#" id="example" rel="popover"><img src="img/specialbutton.png"></a> 

2 call a 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 to use buttons for various social networks? If you want to add the facebook button, you should follow the recommendations for this and paste the code generated from there in the content

+4
source

All Articles