Javascript Tooltip / Posts /

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

0

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  10 months ago   viewed: 312    

1 Answer

0

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. 

Milo
  9 months ago

   

Your name*
Password
(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: