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