网上改动的JS图片轮换淡入淡出效果无法实现,求大神解答!!! 5
<styletype="text/css">.image{position:absolute;width:772px;height:434px;float:left;di...
<style type="text/css">
.image{ position:absolute; width:772px; height:434px; float:left; display: none;">}
</style>
<LINK rel=stylesheet type=text/css href="css/lrtk.css">
<SCRIPT type=text/javascript>
var i = 1;
var time1=3000;
var time2.2000;
var isIe=(window.ActiveXObject)?true:false;
var intAlphaStep=(isIe)?5:0.05;
var intTimeStep=20;
var q=null;
var w=null;
var id=null;
var iq=null;
function lh() {
if (i == 3) {
i = 1;
id=document.getElementById("a1");
iq=document.getElementById("a2");
setObjState();
}
else if(i==2){
i++;
id=document.getElementById("a3");
iq=document.getElementById("a1");
setObjState();
}
else {i++;}
id=document.getElementById("a2");
iq=document.getElementById("a3");
setObjState();}
}
function setObjState()
{
if (id.style.display==""){q=1;w=0;setObjClose();}
else{
if(isIe)
{
id.filters.alpha.opacity=0;
}else{
id.style.opacity=0 ;
iq.style.opacity=1;
}
id.style.display='';
document.getElementById("a1").style.display="none";
q=0;
w=1;
setObjOpen();
}
}
function setObjOpen()
{
if(isIe)
{
id.filters.alpha.opacity+=intAlphaStep;
if (id.filters.alpha.opacity<100) setTimeout('setObjOpen()',intTimeStep);
}else{
q+=intAlphaStep;
id.style.opacity =q;
if (q<1) setTimeout('setObjOpen()',intTimeStep);
}
}
function setObjClose()
{
if(isIe)
{
id.filters.alpha.opacity-=intAlphaStep;
if (id.filters.alpha.opacity>0) {
setTimeout('setObjClose()',intTimeStep);}
else {id.style.display="none";iq.style.display="block";}
}else{
q-=intAlphaStep;
if (q>0) {
id.style.opacity =q;
setTimeout('setObjClose()',intTimeStep);}
else {id.style.display='none';iq.style.display="block";}
}
}
</SCRIPT>
</head>
<body style="text-align:center; float:left">
<DIV id="a1" class=image style="display:block"><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/1.jpg" width=772 height=434 onload="return imgzoom(this,600);" ></A> </DIV>
<DIV id="a2" class=image onload="return imgzoom(this,600);" ><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/2.jpg" width=772 height=434></A> </DIV>
<DIV id="a3" class=image onload="return imgzoom(this,600);" ><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/3.jpg" width=772 height=434></A>
</DIV>
</body> 展开
.image{ position:absolute; width:772px; height:434px; float:left; display: none;">}
</style>
<LINK rel=stylesheet type=text/css href="css/lrtk.css">
<SCRIPT type=text/javascript>
var i = 1;
var time1=3000;
var time2.2000;
var isIe=(window.ActiveXObject)?true:false;
var intAlphaStep=(isIe)?5:0.05;
var intTimeStep=20;
var q=null;
var w=null;
var id=null;
var iq=null;
function lh() {
if (i == 3) {
i = 1;
id=document.getElementById("a1");
iq=document.getElementById("a2");
setObjState();
}
else if(i==2){
i++;
id=document.getElementById("a3");
iq=document.getElementById("a1");
setObjState();
}
else {i++;}
id=document.getElementById("a2");
iq=document.getElementById("a3");
setObjState();}
}
function setObjState()
{
if (id.style.display==""){q=1;w=0;setObjClose();}
else{
if(isIe)
{
id.filters.alpha.opacity=0;
}else{
id.style.opacity=0 ;
iq.style.opacity=1;
}
id.style.display='';
document.getElementById("a1").style.display="none";
q=0;
w=1;
setObjOpen();
}
}
function setObjOpen()
{
if(isIe)
{
id.filters.alpha.opacity+=intAlphaStep;
if (id.filters.alpha.opacity<100) setTimeout('setObjOpen()',intTimeStep);
}else{
q+=intAlphaStep;
id.style.opacity =q;
if (q<1) setTimeout('setObjOpen()',intTimeStep);
}
}
function setObjClose()
{
if(isIe)
{
id.filters.alpha.opacity-=intAlphaStep;
if (id.filters.alpha.opacity>0) {
setTimeout('setObjClose()',intTimeStep);}
else {id.style.display="none";iq.style.display="block";}
}else{
q-=intAlphaStep;
if (q>0) {
id.style.opacity =q;
setTimeout('setObjClose()',intTimeStep);}
else {id.style.display='none';iq.style.display="block";}
}
}
</SCRIPT>
</head>
<body style="text-align:center; float:left">
<DIV id="a1" class=image style="display:block"><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/1.jpg" width=772 height=434 onload="return imgzoom(this,600);" ></A> </DIV>
<DIV id="a2" class=image onload="return imgzoom(this,600);" ><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/2.jpg" width=772 height=434></A> </DIV>
<DIV id="a3" class=image onload="return imgzoom(this,600);" ><A href="#" target=_blank><IMG id="imgs" alt=""
src="images/3.jpg" width=772 height=434></A>
</DIV>
</body> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询