图片新闻中图片渐变效果
从www.2500sz.com 中提取出来的。
img 标签的src及A 标签的 href 可以在后台代码中赋值!
<SCRIPT language="javascript">
var ii=0;
var iii=0;
var no=0;
var speed=7;//设置图片翻动速度,现在为8秒钟翻一幅
var imgobj;
var tdobj;
function testobj()
{
var tbbb;
tbbb=document.all.tags("table").item(0);
if (tbbb==null)
{
return false;
}
else
{
imgobj=tbbb.all.tags("img");
tdobj=tbbb.all.tags("td");
if (imgobj.item(0)==null||tdobj.item(0)==null)
{
return false;
}
else
{
return true;
}
}
}
function isobj(obj)
{
if (obj==null)
{
return false;
}
else
{
return true;
}
}
function initimg()
{
var imid, i;
var imgnum=0;
if (isobj(imgobj.item(0))&&isobj(tdobj.item(0)))
{
imgnum=imgobj.length;
for(i=0;i<imgnum;i++)
{
tdobj.item(i).style.display="none";
tdobj.item(i).style.textAlign="center";
imgobj.item(i).style.filter="revealTrans(Duration=4.0, Transition=23)";
imgobj.item(i).style.visibility="hidden";
}
}
return imgnum;
}
function changeimg()
{
var nnn;
if (testobj())
{
nnn=initimg();
showimg();
setInterval("turnit("+nnn+")",speed*1000);
}
else
{
no++;
if (no<3) setTimeout("changeimg()",1000);
}
}
function turnit(num)
{
iii=ii;
if (ii<num-1)
{
ii++;
}
else
{
ii=0
}
hidimg();
setTimeout("showimg()",1000)
}
function showimg()
{
var ele,ele1;
ele=imgobj.item(ii);
ele1=tdobj.item(ii);
ele2=tdobj.item(iii);
if (isobj(ele)&&isobj(ele1)&&isobj(ele2))
{
ele2.style.display="none";
ele1.style.display="";
ele.filters.item(0).apply();
ele.filters.item(0).transition = 12;
ele.style.visibility = "";
ele.filters(0).play(1.0);
}
}
function hidimg()
{
var ele;
ele=imgobj.item(iii);
if (isobj(ele))
{
ele.filters.item(0).apply();
ele.filters.item(0).transition = 12;
ele.style.visibility = "hidden";
ele.filters(0).play(1.0);
}
}
// script writen by Fu Dawei
</SCRIPT>
</HEAD>
<BODY text="#000000" bgColor="#ffffff" leftMargin="0" topMargin="0" onload="changeimg()">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD>
<DIV align="center"><A id="a" runat="server" href="" target="_blank"><IMG id="imga" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
<TD>
<DIV align="center"><A id="b" runat="server" href="" target="_blank"><IMG id="imgb" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
<TD>
<DIV align="center"><A id="c" runat="server" href="" target="_blank"><IMG id="imgc" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
</TR>
</TBODY>
</TABLE>
var ii=0;
var iii=0;
var no=0;
var speed=7;//设置图片翻动速度,现在为8秒钟翻一幅
var imgobj;
var tdobj;
function testobj()
{
var tbbb;
tbbb=document.all.tags("table").item(0);
if (tbbb==null)
{
return false;
}
else
{
imgobj=tbbb.all.tags("img");
tdobj=tbbb.all.tags("td");
if (imgobj.item(0)==null||tdobj.item(0)==null)
{
return false;
}
else
{
return true;
}
}
}
function isobj(obj)
{
if (obj==null)
{
return false;
}
else
{
return true;
}
}
function initimg()
{
var imid, i;
var imgnum=0;
if (isobj(imgobj.item(0))&&isobj(tdobj.item(0)))
{
imgnum=imgobj.length;
for(i=0;i<imgnum;i++)
{
tdobj.item(i).style.display="none";
tdobj.item(i).style.textAlign="center";
imgobj.item(i).style.filter="revealTrans(Duration=4.0, Transition=23)";
imgobj.item(i).style.visibility="hidden";
}
}
return imgnum;
}
function changeimg()
{
var nnn;
if (testobj())
{
nnn=initimg();
showimg();
setInterval("turnit("+nnn+")",speed*1000);
}
else
{
no++;
if (no<3) setTimeout("changeimg()",1000);
}
}
function turnit(num)
{
iii=ii;
if (ii<num-1)
{
ii++;
}
else
{
ii=0
}
hidimg();
setTimeout("showimg()",1000)
}
function showimg()
{
var ele,ele1;
ele=imgobj.item(ii);
ele1=tdobj.item(ii);
ele2=tdobj.item(iii);
if (isobj(ele)&&isobj(ele1)&&isobj(ele2))
{
ele2.style.display="none";
ele1.style.display="";
ele.filters.item(0).apply();
ele.filters.item(0).transition = 12;
ele.style.visibility = "";
ele.filters(0).play(1.0);
}
}
function hidimg()
{
var ele;
ele=imgobj.item(iii);
if (isobj(ele))
{
ele.filters.item(0).apply();
ele.filters.item(0).transition = 12;
ele.style.visibility = "hidden";
ele.filters(0).play(1.0);
}
}
// script writen by Fu Dawei
</SCRIPT>
</HEAD>
<BODY text="#000000" bgColor="#ffffff" leftMargin="0" topMargin="0" onload="changeimg()">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD>
<DIV align="center"><A id="a" runat="server" href="" target="_blank"><IMG id="imga" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
<TD>
<DIV align="center"><A id="b" runat="server" href="" target="_blank"><IMG id="imgb" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
<TD>
<DIV align="center"><A id="c" runat="server" href="" target="_blank"><IMG id="imgc" runat="server" height="128" src="" width="183" border="0"></A></DIV>
</TD>
</TR>
</TBODY>
</TABLE>
img 标签的src及A 标签的 href 可以在后台代码中赋值!