You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Dynamically sizing tooltips Created Feb 17, 2010

This thread is solved

Views: 2070     Replies: 7     Last reply Dec 27, 2011  
You must login first before you can use this feature

Simon
http://www.demodia.com/

Posts: 8

Registered:
Jun 9, 2009

Dynamically sizing tooltips

Posted: Feb 17, 2010

I've seen a couple of other people asking this, but I couldn't see an answer as yet.

I am writing a web application and want to use jQTools to provide the tooltip capability as I already have the library imported for other reasons. My problem is that I don't seem to be able to find a way to readily scale tooltips to fit the size of the content within them. Sometimes I just have a couple of words of help text, others I have several lines.

Does anyone know how to achieve this?

Thanks!

divabanana

Posts: 1

Registered:
May 19, 2010

» Dynamically sizing tooltips

Posted: May 19, 2010

Reply to: Dynamically sizing tooltips, from sharvey
In the tooltip css file, using width:auto will automatically scale the width of the tooltip to the text.
If you want it to go multiline for those tooltips over a certain width, set max-width to a value that suits you.
For example, setting max-width:200px will allow the tooltips to dynamically scale with the content up to 200px but if the text is too long and tries to take it over 200px, it will wrap multiline.

Hope that helps.

bitman

Posts: 43

Registered:
Sep 26, 2008

» » Dynamically sizing tooltips

Posted: Jun 2, 2010

Reply to: » Dynamically sizing tooltips, from divabanana
Setting the width to auto won't scale the background image. This means text can spill over the boundaries if you're not careful.

In other words, I don't think these tooltips can behave like YouTube tooltips where the background somehow auto-scales to the width of the text.

Would enjoy being wrong here :-)

prip

Posts: 2

Registered:
May 21, 2010

» Dynamically sizing tooltips

Posted: Jun 14, 2010

Reply to: Dynamically sizing tooltips, from sharvey
I agree on this one. The background should not depend on the text length.