My client loves the way his old site would fade-in when viewed in IE6. It used the tag:
<meta http-equiv="Page-Enter" content="blendTrans(Duration=.4)" />
But that doesn't work in Firefox. In the Web Design Forum BabyJeff gave me the following script to try. It works in Firefox but not in IE7. Can anyone help me get this to work in both?
****** code **********
<html>
<head>
<title>Test Fading a page in</title>
<style type="text/css">
body {
-moz-opacity: 0;
-khtml-opacity: 0;
opacity: 0;
}
</style>
<script type="text/javascript">
window.onload = fadeInPage;
var fadeStep = 0.1;
var fadeSpeed = 100; // milliseconds (smaller is faster)
function fadeInPage() {
fadePage('in');
}
var fadeHndl = null;
function fadePage(direction) {
var node = document.getElementsByTagName('body')[0];
if (fadeHndl == null) {
node.myOpacity = (direction == 'in') ? 0 : 1;
fadeHndl = setInterval('fadePage("' + direction + '")', fadeSpeed);
} else {
var opacity = getOpacity(node);
if ((opacity >= 1 && direction == 'in') || (opacity <= 0 && direction == 'out')) {
clearInterval(fadeHndl);
fadeHndl = null;
} else {
var newOpacity = (direction == 'in') ? opacity + fadeStep : opacity - fadeStep;
setOpacity(node, newOpacity);
}
}
}
function setOpacity(node, opacity) {
node.myOpacity = opacity;
if (node.style.filter == 'undefined') {
node.style.filter = 'progid
XImageTransform.Microsoft.Alpha(opacity=' + (opacity * 100) + ')';
} else {
node.style.MozOpacity = opacity;
node.style.KhtmlOpacity = opacity;
node.style.opacity = opacity;
}
}
function getOpacity(node) {
if (typeof(node.myOpacity) != 'undefined') return(parseFloat(node.myOpacity));
return(1);
}
</script>
</head>
<body>
<h1>Lorem ipsum</h1>
<p>Dolor sit amet.</p>
</body>
</html>
****** end of code **********
Thanks,
Gary
<meta http-equiv="Page-Enter" content="blendTrans(Duration=.4)" />
But that doesn't work in Firefox. In the Web Design Forum BabyJeff gave me the following script to try. It works in Firefox but not in IE7. Can anyone help me get this to work in both?
****** code **********
<html>
<head>
<title>Test Fading a page in</title>
<style type="text/css">
body {
-moz-opacity: 0;
-khtml-opacity: 0;
opacity: 0;
}
</style>
<script type="text/javascript">
window.onload = fadeInPage;
var fadeStep = 0.1;
var fadeSpeed = 100; // milliseconds (smaller is faster)
function fadeInPage() {
fadePage('in');
}
var fadeHndl = null;
function fadePage(direction) {
var node = document.getElementsByTagName('body')[0];
if (fadeHndl == null) {
node.myOpacity = (direction == 'in') ? 0 : 1;
fadeHndl = setInterval('fadePage("' + direction + '")', fadeSpeed);
} else {
var opacity = getOpacity(node);
if ((opacity >= 1 && direction == 'in') || (opacity <= 0 && direction == 'out')) {
clearInterval(fadeHndl);
fadeHndl = null;
} else {
var newOpacity = (direction == 'in') ? opacity + fadeStep : opacity - fadeStep;
setOpacity(node, newOpacity);
}
}
}
function setOpacity(node, opacity) {
node.myOpacity = opacity;
if (node.style.filter == 'undefined') {
node.style.filter = 'progid
} else {
node.style.MozOpacity = opacity;
node.style.KhtmlOpacity = opacity;
node.style.opacity = opacity;
}
}
function getOpacity(node) {
if (typeof(node.myOpacity) != 'undefined') return(parseFloat(node.myOpacity));
return(1);
}
</script>
</head>
<body>
<h1>Lorem ipsum</h1>
<p>Dolor sit amet.</p>
</body>
</html>
****** end of code **********
Thanks,
Gary