/    Sign up×
Community /Pin to ProfileBookmark

Do something else in Opera

Hi all

I’m using this to create an alpha background in a site.

[CODE]
.alphalayer{
filter: alpha(opacity=0);
-moz-opacity: 0.0;
opacity: 0.0;
}
[/CODE]

It works great in IE, NS, Firefox but NOT Opera.

in Opera (and on a MAC I think?) it is just a grey box.

Is there any way of putting some sort of condition in there it tell it to do something else if is opera or on a mac.

Chris

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@IncaWarriorOct 25.2004 — background-image: url("back.gif");
Copy linkTweet thisAlerts:
@Stephen_PhilbinOct 25.2004 — I think you're missing some Opera proprietary code too. You could use a png instead though. That's what I do.
Copy linkTweet thisAlerts:
@cybercampbellauthorOct 25.2004 — will this is exactly what I'm doing:

css:
[code=php]
#alphabg {
position:absolute;
left:36px;
top:359px;
width:703px;
height:140px;
z-index:4;
background-color: #CFD0CD;
layer-background-color: #CFD0CD;
border: 1px none #000000;
visibility: hidden;
}
.alphalayer{
filter: alpha(opacity=0);
-moz-opacity: 0.0;
opacity: 0.0;
}
[/code]

javascript:
[code=php]
var val=0;
function fade(){
document.getElementById('alphabg').style.filter='alpha(opacity='+val+')';
document.getElementById('alphabg').style.MozOpacity=val/100;
val++;
if (val<30)setTimeout('fade()',10);
}
[/code]

HTML:
[code=php]
<body onLoad="fade()">
<div id="alphabg" class="alphalayer"></div>
[/code]


The grey box is fading in from 0 to an amount that looks good. but in Opera and on a MAC it just shows the grey box at full which looks BAD.

So who could I incorporate a PNG with alpha channel in this process without interfering with the existing fade/alpha that works in the other browsers.

Cheers

Chris
Copy linkTweet thisAlerts:
@cybercampbellauthorOct 27.2004 — No takers??????

Anyone else got any ideas?

Chris
Copy linkTweet thisAlerts:
@IncaWarriorOct 27.2004 — Opera doesn't make stuff like that.
×

Success!

Help @cybercampbell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...