admin管理员组文章数量:1310441
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;
}
I have this popover in the code above. I'm trying to show a scroll bar on the left of the popover content, but this code doesn't work. Any help will be appreciated. Thanks!
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;
}
I have this popover in the code above. I'm trying to show a scroll bar on the left of the popover content, but this code doesn't work. Any help will be appreciated. Thanks!
Share Improve this question asked Jan 29, 2014 at 12:32 ValentinoValentino 2,1351 gold badge20 silver badges26 bronze badges1 Answer
Reset to default 7This is because your CSS declaration is wrong. You should separate the selectors with ma ,
:
.pop-div, .popover-content {
not
.pop-div .popover-content {
in this case .pop-div
is unnessecary, you only need
.popover-content {
height: 50px;
overflow-y: scroll;
}
see fiddle -> http://jsfiddle/tv5Vu/
本文标签: javascriptBootstrap 3 popover scroll doesn39t workStack Overflow
版权声明:本文标题:javascript - Bootstrap 3 popover scroll doesn't work - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741831789a2399976.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论