图片自支渐变效果

发布时间:2024-06-01 16:54 发布:上海旅游网

问题描述:

不同方式进行渐变。

问题解答:

网上的 代码很多的
放在 body 和body 之间
<script language="javascript">
var pic=new Array();
var num=0;
pic[num++]="http://gg.blueidea.com/2005/alipay/208x32.gif";
pic[num++]="http://gg.blueidea.com/2005/chinaok/ad02-2.gif";
pic[num++]="http://www.blueidea.com/gg/scw/logo.gif";
pic[num++]="http://www.blueidea.com/gg/blueidea/2004/painter.jpg";
var a=0;
var pic_src=new Array();
for(i=0;i<pic.length;i++)
{pic_src[i]=new Image();
pic_src[i].src=pic[i];}
function show_pic(){
if(document.all){
tran=Math.floor(Math.random()*23)+1;
//alert(tran);
document.all.the_pic.style.filter="revealtrans(dulation=2,transition="+tran+")";
document.all.the_pic.filters.revealtrans.Apply();}
a+=1;
if(a>pic.length-1)
{a=0;}
document.all.the_pic.src=pic_src[a].src;
if(document.all){
document.all.the_pic.filters.revealtrans.Play();}
}
function setinter(){
change=setInterval('show_pic()',3000);
}
</script>
<body onLoad="setinter();">
<img src="http://gg.blueidea.com/2005/alipay/208x32.gif" name="the_pic" width=130 height=80 >
</body>

新发现的一个效果更出色的图片透明渐变,这次的效果新增了触发初期的高光闪动,更接近flash的效果!<BR><BR>制作方法:<BR>把代码加到<head>和</head>中,下载 flashimg.js 文件<BR><SCRIPT language=Javascript src="flashimg.js" type=text/javascript></SCRIPT><BR><BR>更改图片链接:<BR><A href="#"><IMG onmouseover="this.style.filter='alpha(opacity=100)';high(this)" onmouseout="low(this)" height="200" src="1.gif" width="149" border="0"></A><BR><BR>至此你就可以完成这个实例了,快去试试吧! <br> 网页教学网

热点新闻