Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

Pixel width of text

Author Message
IanTheMacFan
No longer registered


Joined: 27 May 2005
Posts: 79
Location: calgary, ab

Posted: Sun Jan 15, 2006 - 8:05 pm    Post subject: Pixel width of text Reply with quote

For the new version of the Halloween Counter widget (yes, I know it's January...), I need to get the width of text in pixels. This is so that the rectangle thing with the number can be automatically resized. Does anyone know how to do it?
_________________
I hate my username
My Widgets
View user's profile Send private message Send e-mail Widgets
islayer



Joined: 21 Apr 2005
Posts: 66

Posted: Sun Jan 15, 2006 - 8:26 pm    Post subject: Reply with quote

Code:
document.defaultView.getComputedStyle(document.getElementById("textdiv"), '').getPropertyValue('width');
View user's profile Send private message Send e-mail Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group