Javascript Tooltip / Posts /

How to adjust the popup div size according to the content?


I am using following to pop a tooltip when mouse over each line of a table.

tooltip.pop(that, '#tip', {sticky:false, position:0});

as the content of div:tip is changing for each line. but looks like the size of mcTooltip is fixed. The size is always the one that the tooltip popup the first time. so how I can adjust the size according to the content of div:tip?

Kevin  one year ago   viewed: 459    

1 Answer


You can set a cssClass to the tooltip (see How to Use => Tooltip Options), and in the cssClass style settings, you can use the absolute font size unit: rem. 

rem values are relative to the root html element.

For example, you can set your tooltip.js: 

var tooltipOptions= {

    cssClass: "tooltip123",

    license: "mylicense"


and in your CSS:

.tooltip123 {

    font-size: 1.2rem;


Please have a try. 

  one year ago


Your name*
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: