admin管理员组文章数量:1394743
Could someone please help me. I'm looking for a solution for setting a maxwidth
on a Tooltipster tooltip bubble. I'm not talking about the area which activates the tooltip, I'm talking about the tooltip bubble itself. When I put a few sentences of text in a tooltip it stretches from the left to the right of my screen and sometimes goes off the page. I want to be able to set a max width at say 400px, where anything in excess would be broken onto a new line.
tooltipster-maxwidth
I already checked and tried changing this in the javascript file:
maxWidth Set a maximum width for the tooltip. Default: null (no max width)
But nothing happened. It still appears like it does in the screenshot. Could it be because I've applied it to a paragraph tag? I tried to apply it to a span tag instead but it did the same thing.
Could someone please help me. I'm looking for a solution for setting a maxwidth
on a Tooltipster tooltip bubble. I'm not talking about the area which activates the tooltip, I'm talking about the tooltip bubble itself. When I put a few sentences of text in a tooltip it stretches from the left to the right of my screen and sometimes goes off the page. I want to be able to set a max width at say 400px, where anything in excess would be broken onto a new line.
tooltipster-maxwidth
I already checked and tried changing this in the javascript file:
maxWidth Set a maximum width for the tooltip. Default: null (no max width)
But nothing happened. It still appears like it does in the screenshot. Could it be because I've applied it to a paragraph tag? I tried to apply it to a span tag instead but it did the same thing.
Share Improve this question edited Sep 11, 2014 at 11:52 neelsg 4,8425 gold badges37 silver badges58 bronze badges asked Sep 11, 2014 at 11:41 JonnyJonny 311 silver badge2 bronze badges1 Answer
Reset to default 10The maxWidth
option that's given with Tooltipster is one that needs to be passed into the tooltipster()
function when you initialise the tooltip itself, i.e.
$('.tooltip').tooltipster({
// Other setup goes in here as key:value pairs
'maxWidth': 500
});
From the example above, this will "restrict" your tooltips to occupy a max width of 500 pixels. I've setup a very simple JSFiddle showing various examples with custom maxWidth
options which should help you out with the syntax.
I hope this helps :)
本文标签: javascriptTooltipster maxWidth settingStack Overflow
版权声明:本文标题:javascript - Tooltipster maxWidth setting - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744104949a2591022.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论