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/