问题
I have to use bind html inside tooltip using tooltipster jquery
. But I have to bind more data inside tooltip.
How to implement scrollbar inside tooltip using tooltipster jquery? I have to tooltipster jquery and tooltipster css.
I have used code below:
$('#MainContent').tooltipster({
trigger:"click",
contentAsHTML: true,
content: thtmlcnt,
position:"right",
autoClose:"true",
positionTracker:true
});
Please give some solution how to implement scroll bar inside tooltip.
回答1:
You can achieve this by giving the content a max-height for example
jQuery
$('#MainContent').tooltipster({
trigger:"click",
contentCloning: false,
content: $('.content').detach(),
position:"right",
autoClose:"true",
positionTracker:true
});
HTML
<div class="content" style="max-height:100px">
//Your content here
</div>
回答2:
Maybe this will help:
.tooltipster-base {
max-height: 300px;
pointer-events: all !important;
}
.tooltipster-box {
display: inline-block !important;
width: 100%;
height: 100%;
overflow: auto;
}
Reference: https://github.com/louisameline/tooltipster-scrollableTip/blob/master/tooltipster-scrollableTip.js
来源:https://stackoverflow.com/questions/35935843/tooltip-with-scrollbar-using-tooltipster