P
Piotr K
Ok, I tried simply everything that came to my mind and now I ran out
of ideas, but to the point - take a look at the code below
// GetStyle returns given style value (works fine)
document.getElementById("inner").style.backgroundColor =
GetStyle("box", "backgroundColor");
document.getElementById("box").style.backgroundColor = "transparent";
<div id="box" style="width: 100px; height: 100px; background-color:
Red">
<div id="inner" style="width: 50px; height: 50px"></div>
</div>
What this code do - it retrieves "background-color" style from "box"
element, assigns it to "inner" and then "box" background gets
transparent. Now the funny part - it works in every browser, except
Opera, where both elements gets transparent background. What's even
more funny, when I replace GetStyle(...) with string "Red" it works
fine (GetStyle also returns string). Can someone explain me what is
going on? It's so illogical that I'm starting to think that maybe this
is a bug in Opera..
Thanks for any help,
P.
of ideas, but to the point - take a look at the code below
// GetStyle returns given style value (works fine)
document.getElementById("inner").style.backgroundColor =
GetStyle("box", "backgroundColor");
document.getElementById("box").style.backgroundColor = "transparent";
<div id="box" style="width: 100px; height: 100px; background-color:
Red">
<div id="inner" style="width: 50px; height: 50px"></div>
</div>
What this code do - it retrieves "background-color" style from "box"
element, assigns it to "inner" and then "box" background gets
transparent. Now the funny part - it works in every browser, except
Opera, where both elements gets transparent background. What's even
more funny, when I replace GetStyle(...) with string "Red" it works
fine (GetStyle also returns string). Can someone explain me what is
going on? It's so illogical that I'm starting to think that maybe this
is a bug in Opera..
Thanks for any help,
P.