Ticket #11041 (closed bug: duplicate)
$('#elem').css('width') in percentage in jquery 1.5.2 vs 1.7.1
|Reported by:||strikernl2||Owned by:|
I'm not actually sure that this is a bug or just intended changed behaviour between jQuery 1.5.2 and 1.6 (and thus 1.7.1), but here goes.
I'm in the process of upgrading a web application from jQuery 1.5.2 to 1.7.1. In jQuery 1.5.2, it was possible to get the percentage CSS value of an element using $('#elem').css('width'), if the element was inside another hidden element.
To be clear, I need the CSS value in PERCENTS and I don't know beforehand whether it will be in percents, or px, or em, or whatever.
For a simple test case, see here: http://jsfiddle.net/strikernl/y3P3A/
It seemed to work in 1.5.2, then no longer in 1.7.1. I added 1.6 in the test just to see if that still worked, and it didn't, so it broke somewhere between 1.5.2 and 1.6 I guess.
- Status changed from new to closed
- Resolution set to duplicate