js调用图片隐藏显示的实现代码

复制代码代码如下所示:





无功inttimestep = 20;
无功议=(窗口。ActiveX对象)真的假的;
无功intalphastep =(议)五0.05;
无功cursobj = null;
无功curopacity = null;
功能startobjvisible(objId)
{
cursobj = document.getelementbyid(objId);
setobjstate();
}
功能setobjstate(evtarget)
{
如果(cursobj。风格。显示= =){ curopacity = 1;setobjclose();}
别的{
如果(议)
{
cursobj。风格。csstext =显示:无;Z指数:1;过滤器:α(不透明度0);位置:绝对的;;;;
cursobj。过滤器。阿尔法。不透明度:0;
}其他
{
cursobj。风格。不透明度:0
}
cursobj。风格显示= '';
curopacity = 0;
SetObjOpen();
}
}
setobjopen()函数
{
如果(议)
{
cursobj。过滤器。阿尔法。混浊+ = intalphastep;
如果(cursobj。过滤器。阿尔法。透明度<100)('setobjopen setTimeout()',inttimestep);
其他{ }
curopacity + = intalphastep;
cursobj.style.opacity = curopacity;
如果(curopacity<1)('setobjopen setTimeout()',inttimestep);
}
}
setobjclose()函数
{
如果(议)
{
cursobj。过滤器。阿尔法。混浊- = intalphastep;
如果(cursobj。过滤器。阿尔法。透明度> 0){
('setobjclose setTimeout()',inttimestep);}
别的{ cursobj。风格。显示为无;}
其他{ }
curopacity = intalphastep;
如果(curopacity > 0){
cursobj.style.opacity = curopacity;
('setobjclose setTimeout()',inttimestep);}
别的{ cursobj。风格。显示=不关;}
}
}