T
TJO
Below is some sample code that fades div tags that is not working in IE
6.0.29 on xp sp2. Can anyone help see why the if(ie5)
document.getElementById(divID).filters.alpha.opacity lines are not
working ? I cannot find a solution yet.
THanks
<script type="text/javascript" language=javascript>
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
//fades DIV tag IN
function fadeIn(divID, StartOpacityLevel, fadeStep)
{
if(StartOpacityLevel >= 0 && StartOpacityLevel < 100)
{
StartOpacityLevel += fadeStep;
if(ie5) document.getElementById(divID).filters.alpha.opacity =
StartOpacityLevel;
if(ns6) document.getElementById(divID).style.MozOpacity =
StartOpacityLevel/100;
setTimeout('fadeIn(\'' + divID + '\',' + StartOpacityLevel + ',' +
fadeStep + ')', 5);
}
}
//fades a DIV Tag IN
function fadeOut(divID, StartOpacityLevel, fadeStep)
{
if(StartOpacityLevel > 0 && StartOpacityLevel <= 100)
{
StartOpacityLevel -= fadeStep;
if(ie5) {document.getElementById(divID).filters.alpha.opacity =
StartOpacityLevel;}
if(ns6) document.getElementById(divID).style.MozOpacity =
StartOpacityLevel/100;
setTimeout('fadeOut(\'' + divID + '\',' + StartOpacityLevel + ',' +
fadeStep + ')', 5);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Button2" type="button" value="On"
onclick="fadeIn('mydiv', 0, 10)" />
<input id="Button1" type="button" value="Off"
onclick="fadeOut('mydiv', 100, 10)" /> <br />
<div id="mydiv">
<label for="Text1"></label>
<input id="Text1" type="text" />
<input id="Button3" type="button" value="button" />
</div>
</form>
</body>
6.0.29 on xp sp2. Can anyone help see why the if(ie5)
document.getElementById(divID).filters.alpha.opacity lines are not
working ? I cannot find a solution yet.
THanks
<script type="text/javascript" language=javascript>
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
//fades DIV tag IN
function fadeIn(divID, StartOpacityLevel, fadeStep)
{
if(StartOpacityLevel >= 0 && StartOpacityLevel < 100)
{
StartOpacityLevel += fadeStep;
if(ie5) document.getElementById(divID).filters.alpha.opacity =
StartOpacityLevel;
if(ns6) document.getElementById(divID).style.MozOpacity =
StartOpacityLevel/100;
setTimeout('fadeIn(\'' + divID + '\',' + StartOpacityLevel + ',' +
fadeStep + ')', 5);
}
}
//fades a DIV Tag IN
function fadeOut(divID, StartOpacityLevel, fadeStep)
{
if(StartOpacityLevel > 0 && StartOpacityLevel <= 100)
{
StartOpacityLevel -= fadeStep;
if(ie5) {document.getElementById(divID).filters.alpha.opacity =
StartOpacityLevel;}
if(ns6) document.getElementById(divID).style.MozOpacity =
StartOpacityLevel/100;
setTimeout('fadeOut(\'' + divID + '\',' + StartOpacityLevel + ',' +
fadeStep + ')', 5);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Button2" type="button" value="On"
onclick="fadeIn('mydiv', 0, 10)" />
<input id="Button1" type="button" value="Off"
onclick="fadeOut('mydiv', 100, 10)" /> <br />
<div id="mydiv">
<label for="Text1"></label>
<input id="Text1" type="text" />
<input id="Button3" type="button" value="button" />
</div>
</form>
</body>