javascript - Styling "popovers" in Twitter Bootstrap's “bootstrap-popover.js” in Rails 3.2 - Stack Ove

Using Rails 3.2 and Twitter Bootstrap “bootstrap-popover.js" and "bootstrap-tooltip.js"

Using Rails 3.2 and Twitter Bootstrap “bootstrap-popover.js" and "bootstrap-tooltip.js" here

This is what I'd like to happen :

for when I hover over:

 <li>
  <a href="#" class="thumbnail"><img src="" alt=""></a>
 </li>

In both “bootstrap-popover.js" and "bootstrap-tooltip.js" I have $('a').popover(placement:'top');.

What other options could I possibly specify in order to have the popout appear like it is in the picture above, with options "A title" and "And here's some amazing content. It's very engaging right?"

Here's a pic of what I currently get:

Thanks.

Using Rails 3.2 and Twitter Bootstrap “bootstrap-popover.js" and "bootstrap-tooltip.js" here

This is what I'd like to happen :

for when I hover over:

 <li>
  <a href="#" class="thumbnail"><img src="http://placehold.it/125x100" alt=""></a>
 </li>

In both “bootstrap-popover.js" and "bootstrap-tooltip.js" I have $('a').popover(placement:'top');.

What other options could I possibly specify in order to have the popout appear like it is in the picture above, with options "A title" and "And here's some amazing content. It's very engaging right?"

Here's a pic of what I currently get:

Thanks.

Share Improve this question edited May 18, 2012 at 23:50 Elias7 asked May 18, 2012 at 18:47 Elias7Elias7 12.9k13 gold badges38 silver badges36 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

Here is a working example of what it sounds like you want: http://jsfiddle/chapmanc/DuKCg/4/

Also you only need to put the line of javascript in one place. I usually create a new .js file with all my custom functions and include that in my page the same way you are including the popover and tooltip scripts.

For example the bottom of your file might look like:

<script src="js/jquery.js" type="text/javascript"></script> 
<script src="js/bootstrap.js" type="text/javascript"></script>
<script src="js/bootstrap-tooltip.js" type="text/javascript"></script>
<script src="js/bootstrap-popover.js" type="text/javascript"></script>
<script src="js/customFunctions.js" type="text/javascript"></script>

With customFunctions.js having the:

$('a').popover({placement:'right'});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745560761a4633093.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信