tooltip with scrollbar using tooltipster

半世苍凉 提交于 2020-12-13 01:24:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!