How set opacity / transparency for a layer

G

Guest

I can set the opacity for a layer using a script (below):
function setOpacity(value) {
layer1.style.opacity = value;
layer1.style.filter = 'alpha(opacity=' + value + ')';
}
How can I do it using Frontpages Behaviours? i.e what's the syntax for the
properties and value options when using the Add behaviours dialogue.
PS - I need it to work on as many browsers as possible, which is why the
script above has 2 variants.
 
G

Guest

Thanks Steve,
but I need to vary/alter the transparency dynamically, so doing it in an
image editor is no good.

Yes - only IE uses Filters - Do you know how/where to put:
layer1.style.filter = 'alpha(opacity=' + value + ')'
into the Properties and Value fields?
Some/Other browsers use:
layer1.style.opacity = value;
I tried using "style.opacity" in the Properties field
and "50" (ie 50%) in the value field, but Firefox didnt seem to recognise it
Any other ideas?
 
?

.._..

Barry said:
Thanks Steve,
but I need to vary/alter the transparency dynamically, so doing it in an
image editor is no good.

Yes - only IE uses Filters - Do you know how/where to put:
layer1.style.filter = 'alpha(opacity=' + value + ')'
into the Properties and Value fields?
Some/Other browsers use:
layer1.style.opacity = value;
I tried using "style.opacity" in the Properties field
and "50" (ie 50%) in the value field, but Firefox didnt seem to recognise
it
Any other ideas?

FireFox isn't going to recognize it, ever.

Stop thinking it will, cuz it won't.

Figure out how to do what you want to do with other means, or accept the
fact that a significant minority of your users will not see the graphics as
you intend.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top