0
我正在使用Twitter Bootstrap指示当前显示在屏幕上的文章部分。无论点击如何,总是显示弹出消息。我面临的问题是在滚动期间弹出窗口闪烁。我希望弹出窗口能够稳定并显示没有闪烁的消息。我该怎么做 ?页面滚动期间Bootstrap弹出窗口闪烁
引导酥料饼:
<a href="#" id="example" class="btn btn-primary" rel="popover" data-content="This is the body of Popover" data-placement="left"
jQuery代码:
$(function() {
$('#example').popover();
});
$(window).scroll(function() {
var current = $('[name = "scroll"]');
if($(window).scrollTop() > 0) {
current.attr("data-content", "Introduction");
current.popover("show");
}
if($(window).scrollTop() > 620) {
current.attr("data-content", "Main Passage");
current.popover("show");
}
});
这里的工作演示:http://jsfiddle.net/abyz19ja/
这工作正常。但是我遇到了pop-of-z-index的问题。我做得比标题还要小。但是,当页面滚动时,该消息仍置于标题之上。我希望他们去下面。 –
你试过z-index:-1;在.popover上?您也可能需要在弹出窗口上使用“容器”选项。 $('#example')。popover({container:'.title-parent-element'}); – partypete25