javascript - Why does last popover link in navbar not centre on object? -


i using bootstrap.js build simple ui. part of ui want use navbar.

on navbar, have popover under each of items in navbar. works ok.

what have noticed, popover on last link item in nav bar not position correctly.

it not matter if last item third of three, or sixth of six, last item affected.

i can workaround not using popover on last item, not understand why occurring.

i have tested in chrome 28 , firefox 21 locally same results.

my question is: why last popover in code below cause strange rendering issue?

nice example (cursor hovering on middle link) : cursor hovering on middle link

yucky example (cursor hovering on last link): rendering not quite right on popover

the code using reproduce behaviour:

<html> <head><link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" media="screen"></head> <body> <div class="navbar">   <div class="navbar-inner">     <ul class="nav">       <li><a href="#" id="l1" rel="popover">abcdefg</a></li>       <li><a href="#" id="l2" rel="popover">abcdefg</a></li>       <li><a href="#" id="l3" rel="popover">abcdefg</a></li>            </ul>     </div> </div> <script src="http://code.jquery.com/jquery.js"></script> <script src="http:///netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap-popover.js"></script> <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap-tooltip.js"></script> <script> $(function ()   {      var globaldelay = { show: 200, hide: 100 };     var lcontent = "abcdefg abcdefg abcdefg";     var ltitle = "abcdefg abcdefg abcdefg";     $("#l1").popover({placement:'bottom', trigger:'hover', content:lcontent ,title:ltitle, delay:globaldelay});      $("#l2").popover({placement:'bottom', trigger:'hover', content:lcontent ,title:ltitle, delay:globaldelay});      $("#l3").popover({placement:'bottom', trigger:'hover', content:lcontent ,title:ltitle, delay:globaldelay});  });   </script>  </body> </html> 

it appears relate width of object contains list items.

if make slight change code above (shown below), can workaround behaviour. appears width of ul object rendered bootstrap, causes final popover chopped short, results in arrow div offset against list item in navbar.

<div class="navbar">   <div class="navbar-inner">     <ul class="nav" style="width:100%;">       <li><a href="#" id="l1" rel="popover">abcdefg</a></li>       <li><a href="#" id="l2" rel="popover">abcdefg</a></li>       <li><a href="#" id="l3" rel="popover">abcdefg</a></li>            </ul>     </div> </div> 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -