n(n>>2)幅图片轮换擦洗显示
一般的做法,只能显示两张图片,因为wipe擦洗技术限制只能两张图片间切换花。 但可以通过将两张图片转为动画交替显示
<script>
var i=0,pictures=new array();//设置图片数组,图片数为奇数
var picbase="";
pictures[i++]="1.gif"
pictures[i++]="2.gif"
pictures[i++]="3.gif"
pictures[i++]="4.gif"
pictures[i++]="5.gif"
pictures[i++]="6.gif"
pictures[i++]="7.gif"
pictures[i++]="8.gif"
pictures[i++]="9.gif"
pictures[i++]="10.gif"
pictures[i++]="11.gif"
pictures[i++]="12.gif"
pictures[i++]="13.gif"
pictures[i++]="14.gif"
pictures[i++]="15.gif"
pictures[i++]="16.gif"
pictures[i++]="17.gif"
pictures[i++]="18.gif"
pictures[i++]="19.gif"
pictures[i++]="20.gif"
pictures[i++]="21.gif"
pictures[i++]="22.gif"
var picturewidth=400//图片宽度
var pictureheight=290//图片高度
var delay=1//延迟时间
</script>
<script>
if (document.all) {
document.write(<object id="dacontrol_wipe" )
document.write(style="width:+picturewidth+;height:+pictureheight+")
document.write(classid="clsid:b6ffc24c-7e13-11d0-9b47-00c04fc2f51d">)
document.write(</object>)
m = dacontrol_wipe.meterlibrary;
whattransformation = new activexobject("dximagetransform.microsoft.wipe");
whattransformation.gradientsize = 1.0;//设置渐变度
whattransformation.wipestyle = 0;//设置擦洗类型
var myarr=new array(),myarr2=new array();
var len=math.floor(pictures.length/2);//将图片分成两组
for(var i=0;i<len;i++){
myarr[i]=m.importimage(picbase+pictures[2*i])
myarr2[i]=m.importimage(picbase+pictures[2*i+1])
}
if(pictures[2*i])
myarr[i]=m.importimage(picbase+pictures[2*i])
else
myarr[i]=m.importimage(picbase+pictures[0]) ;
myarr=m.array(myarr)
myarr2=m.array(myarr2)
index = m.interpolate(0.5,len+0.5,len*2*delay).repeatforever();
index2 = m.interpolate(0,len,len*2*delay).repeatforever();
//交错运行半个时间单元
var whatpictures=new array();
whatpictures[0] = myarr.nthanim(index);
whatpictures[1] = myarr2.nthanim(index2);
forward = m.interpolate(0, 1, delay);
back = m.interpolate(1, 0, delay);
whatmovement = m.sequence(forward, back).repeatforever();
//设置参数方向
theresult = m.applydxtransform( whattransformation, whatpictures, whatmovement );
dacontrol_wipe.image = theresult.outputbvr;//设置显示图形
dacontrol_wipe.start();//开始
}
</script>
使用的技巧区别于以往的主要在将图片交替转为两个数组,利用内部计数interpolate和nthanim技术实现动画。
()
- · 小偷程序原理和简单示例
- · 精彩教程:快速初始化内存(1)
- · 用Flash和XML来构造一个聊天室
- · 个人Internet网站创建过程详解
- · 在C#中调用VBScript等脚本的实现(下)
- · 在C#中调用VBScript等脚本的实现(上)
- · 设计模式之代理模式(Proxy)
- · 如何给DataGrid添加双题头分类显示
- · ASP漏洞全接触-高级篇
- · 轻松玩转弹出窗口
- · ASP漏洞全接触-入门篇
- · IIS服务器组建攻略
- · 其实做小偷是很容易的
- · XMLHTTP下载远程数据输出到浏览器
- · Jave基础学习:jdbc小技巧
- · 一棵php的类树(支持无限分类)
- · 用asp.net 实现九连环小游戏
- · MySQL数据导入导出方法与工具介绍(1)
- · 轻松弹出无边框网页的Javscrpt代码
- · ASP初学者参考
- · Java新手学习:IIS6和Tomcat5的整合
- · asp常用函数
- · W3 Jmail中文使用说明
- · 无组件上传图片到数据库中,最完整解决方案
- · 二级域名原理以及程序,申请即可开通
- · Java学习过程的一些重点
- · Oracle9i中如何建立不同字符集的数据库
- · 修复SQL Server 2000数据库之实战经验
- · 使用ASP生成HTML文件
- · 编写安全的ASP代码
- · 十天学会ASP.net(2)
- · 十天学会ASP.net(1)
- · 十天学会php(2)
- · 十天学会php(1)
- · 三天学好ADO
- · 在数据库中存取文件
- · 解决大字段在Form中Post出错的方法
- · 利用ASP+JMAIL进行邮件群发的新思路
