2014-01-29 32 views
2

我有這個(簡單?)問題:在我的頁面我有一個popover,其元素是動態生成的。如何在彈出窗口底部修正div(特別是id =「foot-notification-pop」元素),當它滾動時?在代碼下面。謝謝!Bootstrap 3如何修復內容當popover滾動

HTML

<ul class="navbar-nav pull-right"> 
    <li><a href="#" data-toggle="popover" title="Notifications" data-html="true" data-content="<a href='?Profile'><div class='pop-text'>Notification 1</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 2</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 3</div></a><hr /><a href='?Profile'><div class='pop-text'>Notification 4</div></a><hr /><div><p id='foot-notification-pop'><a href='?notification'>Show all</a></p></div>">Notification</a></li> 
</ul> 

CSS

.popover-content { 
max-height: 200px; 
overflow-y: scroll; 
} 

JAVASCRIPT

$('[data-toggle="popover"]').popover({placement: 'bottom', trigger: 'click' }); 
+0

你可以修改HTML/PHP,所以它只是HTML?在PHP處理它並複製之後,只需查看HTML源代碼即可。 – sissonb

+0

希望現在好起來 –

回答

1

一種方式是與position: absolute CSS屬性

#foot-notification-pop { 
    position: absolute; 
    bottom: 0px; 
    background-color:#fff; 
    width:70% 
} 

此外,我將該標識從段落標記移至div標記。

<div id='foot-notification-pop'><p><a href='?notification'>Show all</a></p></div> 
+0

現在我不能檢查,但明天我看到它是否適用於我,而我正在給你寫回復。非常感謝現在,非常感謝 –

+0

好吧,obviusly作品,謝謝:) –