Alex Rivera | Logout

Bootstrap popover clipped to extent of containing div

Asked 2012-11-07T00:09:31.410
8

I want a popover to be contained within a collapsible div: http://jsfiddle.net/nathan9/qgyS7/. However, the popover seems to be limited to the extent of the div. Is there a way to prevent the clipping?

<a href="#toggle" data-toggle="collapse" data-target="#toggle" onClick="return false;">Toggle collapse</a>
<div id="toggle" class="collapse" style="background-color: yellow">
    Content of collapsible div. Click for popover: 
    <i class="icon-info-sign" id="info"></i>
</div>

...

<script>
    $('#info').popover({ html: true, placement: 'left', title: 'Popover', content: "<ul><li>The</li><li>popover</li><li>is</li><li>clipped.</li></ul>" });
</script>
Edit
Report

1 Answer

2

adding .collapse.in {overflow:visible} seems to do the trick

http://jsfiddle.net/ZArX7/

EDIT: Above answer only worked in chrome

Here is a piece of jquery that delays adding the class.

     $('#toggle_link').click(function() {
    if($('#toggle').hasClass('in')){
        $('#toggle').removeClass('visible');
    }else{
        setTimeout(function() {
            $('#toggle').addClass('visible');
        }, 1000);
    }
});   

This solution works

http://jsfiddle.net/fnP7y/

answered 2012-11-07T00:36:03.133

Your Answer