[英]Bootstrap 3 popover scroll doesn't work
的HTML
<div class="pop-div">
<a href="#" data-toggle="popover" title="<strong>Notifiche</strong>" data-html="true" data-content="Notification 1<hr />Notification 2<hr />Notification 3 <hr />Notification 4">Notifications</a>
</div>
JAVASCRIPT
$('[data-toggle="popover"]').popover({placement: 'bottom'});
//hide popover when click outside
$('body').on('click', function (e) {
$('[data-toggle="popover"]').each(function () {
if ($(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
$(this).popover('hide');
}
});
});
的CSS
.pop-div .popover-content {
height: 50px;
overflow-y: scroll;
}
我在上面的代碼中有這個彈出窗口。 我試圖在彈出內容的左側顯示滾動條,但是此代碼不起作用。 任何幫助將不勝感激。 謝謝!
這是因為您的CSS聲明是錯誤的。 您應該選擇用逗號分隔,
:
.pop-div, .popover-content {
不
.pop-div .popover-content {
在這種情況下, .pop-div
是不必要的,您只需要
.popover-content {
height: 50px;
overflow-y: scroll;
}
看到小提琴-> http://jsfiddle.net/tv5Vu/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.