Dilemma:
In my CSS file, I have the following:
div {
-webkit-transform: scale(0.5);
}
In my jQuery, I will then do the following:
$('div).css('-webkit-transform','rotate(3deg)')
What happens (as you can guess) is that the -webkit-transform inline parameter via jQuery overloads the original setting. This is usually normal / expected. But the problem here is that I actually set two completely different styles (scale and rotation), but because webkit uses the same property name for both, one overrides the other.
Can anyone think of an elegant way to handle this? The best I can come up with is to come up with a jQuery function that will parse this particular style and add / subtract from the comma-separated list of values (akin to remove / addClass). However, this can be a problem if dynamically updating nested elements with different transformations. (for example, I have a DIV wrapper that I want to apply to the scale (and its children). One of the children also needs to make a rotation, but keep the scale).
UPDATE:
Upon further investigation, this, apparently, is not necessarily a DOM update issue, but rather an odd cascading CSS issue.
Code example:
<html>
<head>
<style>
#parentSpan {
-webkit-transform: scale(.25);
}
</style>
</head>
<body>
<span id="parentSpan" style="
display: block;
border: 1px solid orange;
width: 600px;
-webkit-transform: rotate(5deg);
">
hello
</span>
HEAD, . , "-webkit-transform". ?
2:
, .
, , . , ().
, , . div, div. div - .