Is there a way to control alpha filters for a single menu item cell?
Is there a way to set it from the get-go without using onfunction/offfunction attibutes?
I am experimenting with the following code for opacity changes...
Code: Select all
function changeOpacity( objID, opacity )
{
document.all[objID].style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + opacity + ");";
}
I have some other code I've got working to manipulate a table cell, but it needs some work.
Code: Select all
var apl = new Array();
apl[0] = new Array(65,"");
apl[1] = new Array(65,"");
apl[2] = new Array(65,"");
apl[3] = new Array(65,"");
// Opacity variables and function
nOpac = 50
nPlus = 2
nMin = 1
speed = 30
timer = null;
timer2 = null;
function topfadein(teller)
{
apl[teller][1] = "Up";
topchanges();
}
function topfadeout(teller)
{
apl[teller][1] = "Down";
setTimeout("topchanges()",50);
}
function topchanges()
{
next_loop = true;
for (i=0;i<apl.length;i++)
{
obj = main.rows[0].cells[i];
opacity = apl[i][0]
if (apl[i][1] == "Up")
{
opacity += nPlus;
apl[i][0] = opacity;
if (apl[i][0] > 105)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
else
{
if (apl[i][1] == "Down")
{
opacity -= nMin;
apl[i][0] = opacity;
if (apl[i][0] < 65)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
}
if(ie5){
obj.style.filter="alpha(opacity="+opacity+")";
}
if(ns6){
obj.style.MozOpacity = opacity + '%';
}
}
if (next_loop == false)
{
timer = setTimeout("topchanges()",speed);
}
else
{
clearTimeout(timer);
}
}