Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set max-width of dijit.ToolTip?

I tried the following, but it didn't seem to work.

var helpIcon = dojo.create("span", {"class":"help-icon", innerHTML:"[?]"}, td1);
var tooltip = new dijit.Tooltip({
        connectId: [helpIcon],
        label: "large paragraph of text here ... "
    });
tooltip._setStyleAttr("max-width: 100px");

Help!

like image 216
Lightbeard Avatar asked Dec 28 '09 22:12

Lightbeard


2 Answers

Through experimentation, I found that this works:

.dijitTooltip {max-width: 50em;}

like image 195
Lightbeard Avatar answered Oct 01 '22 20:10

Lightbeard


Just put a div inside the ToolTip and limit it's width:

<span id="a">Some Text</span>
<div dojoType="dijit.Tooltip" connectId="a" position="below">
    <div style="width: 400px;">Some Info Some Info Some Info Some Info 
    Some Info Some Info Some Info Some Info Some Info Some Info Some Info 
    Some Info Some Info Some Info Some Info Some Info Some Info Some Info 
    Some Info Some Info Some Info Some Info Some Info Some Info </div>
</div>
like image 32
Robert Johnstone Avatar answered Oct 01 '22 22:10

Robert Johnstone