Twitter bootstrap 当目标在一个附加的容器中时,为什么引导弹出框会被压扁?
说得最好,但我有一个爆米花触发器,工作正常。但是,如果我把容器粘上,爆米花就会被压扁。为什么以及如何补救Twitter bootstrap 当目标在一个附加的容器中时,为什么引导弹出框会被压扁?,twitter-bootstrap,popover,affix,Twitter Bootstrap,Popover,Affix,说得最好,但我有一个爆米花触发器,工作正常。但是,如果我把容器粘上,爆米花就会被压扁。为什么以及如何补救 <script type="text/javascript"> $(function () { $(".popover-trigger").popover({ content: function () { return $("#popover-content").html(); } }); $(".
<script type="text/javascript">
$(function () {
$(".popover-trigger").popover({
content: function () {
return $("#popover-content").html();
}
});
$(".btn").click(function(){
var jq = $(".popover-trigger").parent().toggleClass("affix");
var state = jq.hasClass("affix") ? "" : "not";
$(".state").html(state);
});
});
</script>
<div id="popover-content" class="hide">Lorem ipsum dolor sit amet ... </div>
<div class="container">
<div class="row">
<div class="well">
<div class="popover-trigger" data-trigger="hover" data-toggle="popover" data-original-title="Popover" data-html="true">
I'm <span class="state">not</span> affixed.
<button class="btn">Toggle</button>
</div>
</div>
</div>
</div>
$(函数(){
$(“.popover触发器”).popover({
内容:功能(){
返回$(“#popover内容”).html();
}
});
$(“.btn”)。单击(函数(){
var jq=$(“.popover触发器”).parent().toggleClass(“粘贴”);
var state=jq.hasClass(“词缀”)?:“非”;
$(“.state”).html(state);
});
});
我爱你,我爱你。。。
我没有被贴上标签。
切换
参见更新
我不是专家,但在CSS中定义popover的大小有助于确保它保持其形状。这是通过调用
popover{height:x;width:y}
完成的,不知道为什么,但是设置popover的容器
选项修复了我的问题,如中所示。抱歉,但是高度和宽度选项并没有解决我的问题。正如您在自己的回答中提到的,容器选项比设置高度和宽度更好。爆米花不许动!很高兴你解决了这个问题。