Forum Moderators: open
Any help appreciated.
Googly
Fade-in text requires you to cycle through a series of text colors. And I think there were also some proprietary IE functions along these lines - but they sure weren't cross browser. With AOL going toward Gecko and who-knows-what for DOM support, I sure wouldn't write any proprietary code right now.
The problem is, you can create the illusion of a fade-in, but in reality, that's not what's going on. So I'm at a loss as to how you would fade-in an entire div.
<html>
<head>
<script language="JavaScript">
//fades layer in
ie5 = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);
opac = 0;
function fadeIn() {
if(opac!= 100){
opac+=1;
if(ie5) document.getElementById('nameoflayer').filters.alpha.opacity = opac;
if(ns6) document.getElementById('nameoflayer').style.MozOpacity = opac/100;
setTimeout('fadeIn()', 50);
}
}
</script>
</head>
<body onLoad="opacIn(); fadeIn(); fadeOut();">
<div id="nameoflayer" style="position:absolute; left:100px; top:150px; width:100px; height:100px; clip:rect(0,100,100,0); filter: alpha(opacity=0); -moz-opacity:0%; background-color:red; z-index:1">
</div>
</body>
</html>
Does anyone have any idea of how to make it work?
Googly
It is because the content which I am fading in doesn't work on the Mac anyway. So now the Mac User is just left with a lovely logo instead.
(Please don't get angry all you Mac users!)
Thanks for your views folks.
Googly
FYI: the "-name-" prefix is the officially sanctioned mechanism for adding experimental or proprietary keywords to CSS. [...]
Many mozilla extensions, like opacity and border-radius have been proposed to become part of the standard and are considered experimental implementations. The "-moz-" prefix will be dropped (but still supported for backward compatibility) when/if it becomes part of the standard. Another benefit of having the prefixed version is that the CSS committee is free to modify the syntax or behavior of
the property when adding it to the spec and legacy stylesheets will still work against the prefixed version. [...]So '-moz-opacity' isn't really a branching, but an attempt to create a standarized property without stepping on anyone's toes.
IEs 'filter' predated Mozilla's opacity as well as the prefixing mechanism for extensions. It has been proposed for inclusion in the standard (and rejected in its current form) several times.
One thing to note though. If you are running a fairly fast setTimeout routine (and incrementing the fade with a small amount, but in rapid succession) then you will see much better performance on a Win System using IE (unsurprisingly) than using Mozilla.
ALso, on my 1.8 ghz , 1GB ram computer, using linux, it seemed that the mozilla on there was also rendering it rather sluggishly. When I run this same comp in windows, it can run the opacity routine well in mozilla/phoenix or IE.
And of course, using the fade-in is simply not very-standards compliant.
And yes, the filters only work on images, not divs. but its not too hard to make it appear that a div is whats being altered.
One wedding website i worked on works on either mozilla or IE . I'm not going to post it cuz thats bad right? Cna i make it my homepage at least? (cuz thats what I did) Going in and out of the links section on the left causes the routine to run. Beware, the ads geocities throws in make it a mess sometimes.