On Apr 26, 5:19 pm, Ben C <spams...@spam. eggswrote:
Super!! It will take me a while to digest your idea, though...and in
the meantime, may I ask: how about utilizing any CSS 2.x methods?
And, first of all, really -- is your script or pseudo-code there
JavaScript or CSS or both?? Sorry, I'm really not sure where one
stops and the other begins...they'r e so hand-in-hand, after all!
Thanks again!!
>
>
<SNIP>
>
You can also use the CSS 3 opacity property on a div with a background
colour. Although opacity is CSS 3 it's pretty widely supported.
>
If you do it with opacity, just something like this:
>
function step()
{
opacity += tick;
if (opacity >= 1.0)
{
opacity = 1.0;
clearInterval(t imer);
}
veil.style.opac ity = opacity;
>
}
>
var veil = document.getEle mentById("veil" );
var opacity = 0.0;
var tick = 32.0 / (2.0 * 1000); // two second fade
var timer = setInterval(ste p, 32);
>
I haven't tested this so it's probably full of errors, but you get the
idea.
>
Just put some text on top of the veil. If you use opacity bear in mind
that it affects an element and all its descendents, so you'll be able to
see through the text as well. If you want the text opaque but on a
semi-opaque background the text will have to be in a non-descendent
element (probably a sibling, and they're probably both absolutely
positioned).
>
CSS 3 also lets you set rgba background colours which enable you to have
a semi-opaque background (using the "a" or alpha component) with an
opaque foreground without needing to create an extra element, but I'm
not sure that's so widely supported.
>
<SNIP>
>
You can also use the CSS 3 opacity property on a div with a background
colour. Although opacity is CSS 3 it's pretty widely supported.
>
If you do it with opacity, just something like this:
>
function step()
{
opacity += tick;
if (opacity >= 1.0)
{
opacity = 1.0;
clearInterval(t imer);
}
veil.style.opac ity = opacity;
>
}
>
var veil = document.getEle mentById("veil" );
var opacity = 0.0;
var tick = 32.0 / (2.0 * 1000); // two second fade
var timer = setInterval(ste p, 32);
>
I haven't tested this so it's probably full of errors, but you get the
idea.
>
Just put some text on top of the veil. If you use opacity bear in mind
that it affects an element and all its descendents, so you'll be able to
see through the text as well. If you want the text opaque but on a
semi-opaque background the text will have to be in a non-descendent
element (probably a sibling, and they're probably both absolutely
positioned).
>
CSS 3 also lets you set rgba background colours which enable you to have
a semi-opaque background (using the "a" or alpha component) with an
opaque foreground without needing to create an extra element, but I'm
not sure that's so widely supported.
the meantime, may I ask: how about utilizing any CSS 2.x methods?
And, first of all, really -- is your script or pseudo-code there
JavaScript or CSS or both?? Sorry, I'm really not sure where one
stops and the other begins...they'r e so hand-in-hand, after all!
Thanks again!!
Comment