[QA] checking width in %

Amir E. Aharoni amir.aharoni at mail.huji.ac.il
Sun Jan 19 12:18:56 UTC 2014


I couldn't find any JS solution that is more robust than what I already did
using .attribute. jQuery's .css method also returns the computer value in
px. The closest I could find was a suggestion in StackOverflow [1] to use
document.styleSheets, but that wouldn't work in my case, because that is a
style attribute and not a style sheet.

[1]
http://stackoverflow.com/questions/744319/get-css-rules-percentage-value-in-jquery


--
Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
http://aharoni.wordpress.com
‪“We're living in pieces,
I want to live in peace.” – T. Moore‬


2014/1/15 Željko Filipin <zfilipin at wikimedia.org>

> On Tue, Jan 14, 2014 at 8:59 PM, Amir E. Aharoni <
> amir.aharoni at mail.huji.ac.il> wrote:
>
>> Surprisingly, this didn't work: It seems to return the computed value in
>> px, rather than the specified CSS value in %.
>
>
> Can you get the value in percent using JavaScript?
>
> Željko
>
> _______________________________________________
> QA mailing list
> QA at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/qa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20140119/ce5e9480/attachment.html>


More information about the QA mailing list