Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #14332 > unrolled thread
| Started by | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| First post | 2012-06-05 13:13 +1000 |
| Last post | 2012-06-06 22:36 +1000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.javascript
filter: inherit Andrew Poulos <ap_prog@hotmail.com> - 2012-06-05 13:13 +1000
Re: filter: inherit Holger Suhr <holgerholgerde@yahoo.de> - 2012-06-06 11:49 +0200
Re: filter: inherit Andrew Poulos <ap_prog@hotmail.com> - 2012-06-06 22:36 +1000
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2012-06-05 13:13 +1000 |
| Subject | filter: inherit |
| Message-ID | <KIWdnZ9txvbI5FDSnZ2dnUVZ_gednZ2d@westnet.com.au> |
With IE 8 if I have this
.fadein {
filter:alpha(opacity=0);
}
<div id='a'
class='fade'
style="position:absolute; [size and position]>
<div
style="filter:inherit; position:absolute; [size and position]'>
[content]
</div>
</div>
both 'a' and 'b' are transparent (which is as expected) but if I have this
<div id='a'
class='fade'
style="position:absolute; [size and position]>
<div
style="position:absolute; [size and position]'>
[content]
</div>
</div>
and then onload set
document.getElementById('a').getElementsByTagName('div')[0].filter =
"inherit";
the inner DIV stays as opaque. Why doesn't the inner DIV inherit the
style filter of its parent?
Andrew Poulos
[toc] | [next] | [standalone]
| From | Holger Suhr <holgerholgerde@yahoo.de> |
|---|---|
| Date | 2012-06-06 11:49 +0200 |
| Message-ID | <jqn92o$me3$1@news01.versatel.de> |
| In reply to | #14332 |
Am 05.06.2012 05:13, schrieb Andrew Poulos:
> With IE 8 if I have this
>
> .fadein {
> filter:alpha(opacity=0);
> }
>
> <div id='a'
> class='fade'
> style="position:absolute; [size and position]>
> <div
> style="filter:inherit; position:absolute; [size and position]'>
> [content]
> </div>
> </div>
>
> both 'a' and 'b' are transparent (which is as expected) but if I have this
>
> <div id='a'
> class='fade'
> style="position:absolute; [size and position]>
> <div
> style="position:absolute; [size and position]'>
> [content]
> </div>
> </div>
>
> and then onload set
>
> document.getElementById('a').getElementsByTagName('div')[0].filter =
> "inherit";
>
> the inner DIV stays as opaque. Why doesn't the inner DIV inherit the
> style filter of its parent?
>
> Andrew Poulos
are
".fadein {"
and
"class='fade'"
correct?
with
getElementsByTagName('div')[0].filter =
you are changing the outer (first) div
I think
getElementsByTagName('div')[1].filter =
will do it (in this example).
Holger
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2012-06-06 22:36 +1000 |
| Message-ID | <l9udnZ8GZutX01LSnZ2dnUVZ_jmdnZ2d@westnet.com.au> |
| In reply to | #14352 |
On 6/06/2012 7:49 PM, Holger Suhr wrote:
> Am 05.06.2012 05:13, schrieb Andrew Poulos:
>> With IE 8 if I have this
>>
>> .fadein {
>> filter:alpha(opacity=0);
>> }
>>
>> <div id='a'
>> class='fade'
>> style="position:absolute; [size and position]>
>> <div
>> style="filter:inherit; position:absolute; [size and position]'>
>> [content]
>> </div>
>> </div>
>>
>> both 'a' and 'b' are transparent (which is as expected) but if I have
>> this
>>
>> <div id='a'
>> class='fade'
>> style="position:absolute; [size and position]>
>> <div
>> style="position:absolute; [size and position]'>
>> [content]
>> </div>
>> </div>
>>
>> and then onload set
>>
>> document.getElementById('a').getElementsByTagName('div')[0].filter =
>> "inherit";
>>
>> the inner DIV stays as opaque. Why doesn't the inner DIV inherit the
>> style filter of its parent?
>>
>> Andrew Poulos
>
> are
> ".fadein {"
> and
> "class='fade'"
> correct?
Yes, its a typo.
> with
> getElementsByTagName('div')[0].filter =
> you are changing the outer (first) div
> I think
> getElementsByTagName('div')[1].filter =
> will do it (in this example).
I believe its another shortcoming in IE 8. I "fixed" it by applying
filter=inherit in CSS (wrapped in conditional comments) using "div.fade
div" as the selector. Using js to apply the filter wouldn't seem to work.
Andrew Poulos
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web