On Aug 1, 3:42 pm, "george.gsgd" <[EMAIL PROTECTED]> wrote:
> Perhaps think around the problem. Can you get the height of the
> element? That'd be in pixels regardless.
>
> Or maybe use sIFR instead?
>
sIFR was used, but now a server-side method generates the image (i.e.
so Flash isn't required a
Sam Collett wrote:
Another problem is that it wouldn't work if you use % for font size
(which is true in my case).
Getting the height may be a good option (although that also includes
padding).
You simply need to use a reference element that doesn't have padding and
borders.
--Klaus
On Aug 1, 11:13 pm, Luke Lutman <[EMAIL PROTECTED]> wrote:
> I've run into this before, and came up with pretty much the same
> solution as Klaus:
>
> http://jquery.lukelutman.com/plugins/px/jquery.px.js
>
> which you can call like so:
>
> $('#example').px('font-size');
>
> One known bug is that i
Klaus Hartl wrote:
> Couldn't you add an element as direct child to the body, for which you
> define:
>
> position: absolut;
> visibility: hidden;
> height: 1em;
> font-size: 100% !important;
>
> Then you can just poll the height of that element, e.g. the offsetHeight
> and get the current pi
seedy wrote:
Sam Collett wrote:
How can I then convert the %/em value into pixels?
Short Answer : You can't really convert em to pixels as em is a relative
value.
Will this help?:
http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/
-- Scott
seedy wrote:
Sam Collett wrote:
How can I then convert the %/em value into pixels?
Short Answer : You can't really convert em to pixels as em is a relative
value.
Long Answer:
The default font size for browsers is 16px = 1em. So you could make that
assumption and use 16px to calculate yo
Perhaps think around the problem. Can you get the height of the
element? That'd be in pixels regardless.
Or maybe use sIFR instead?
On Aug 1, 9:47 am, Sam Collett <[EMAIL PROTECTED]> wrote:
> When I use $("h1").css("font-size") it differs across browsers.
> Firefox returns it the way I want (in
Sam Collett wrote:
>
> How can I then convert the %/em value into pixels?
>
Short Answer : You can't really convert em to pixels as em is a relative
value.
Long Answer:
The default font size for browsers is 16px = 1em. So you could make that
assumption and use 16px to calculate your pixel
8 matches
Mail list logo