-
Notifications
You must be signed in to change notification settings - Fork 27.4k
jqLite .css() retrieves only inline styles #2866
Comments
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
@btford I updated the fiddle to use Angular v1.0.8 and the issue persists http://jsfiddle.net/redaemn/pbucv/10/ Here I also tried version 1.2.0rc1 and again the issue persists I'd just like to know: is this a bug or is it supposed to work like this? (because jQuery original .css() doesn't work like this...) Thanks for your help! |
I would like this to work like in jQuery. i.e. jqLite's .css() method should return the values even if they are defined in an external CSS file. Without this functionality, I am now forced to include jQuery just for this. Thanks! |
This should either be documented, or fixed (not sure which). |
Fixed, please :-) |
Depends on how heavy the code is. The point of Angular having a jqLite is to avoid duplicating too much of jQuery. At some point, it's cheaper/easier to just include jQuery. Thus, I'm deferring the decision. :) |
Makes sense. Thanks for the quick response. |
Then remove this method completely to avoid confusion OR clearly state this behaviour in docs. There's so little chance of inline styles so those who utilise that approach should really employ jQuery. |
There's a line in one of my jqLite patches to add a call to Also, the currentStyle property (used if msie <= 8) does return not just the inline style, it's essentially |
Encounter same problem here. As @caitp said, I use |
The solution is pretty much the same length! Works in IE6 > and real browsers.
|
+1 |
+1 for @calummoore's solution |
👍 |
1 similar comment
+1 |
+1 @calummoore |
+1 |
1 similar comment
+1 |
This will not be implemented as explained in this comment: #8161 (comment) |
It seems that using jqLite .css() to retrieve styles define inside an external CSS file does not work. I tried this in Chrome 27
http://jsfiddle.net/redaemn/pbucv/1/
The text was updated successfully, but these errors were encountered: