Javascript图片播放类ImageSlide.iclass.js

ImageSlide.js 是一款基于 IE5 及以上版本的浏览器开发的图片轮播插件,支持多种过渡效果及自动播放功能。该插件提供了丰富的自定义选项,如图片播放容器的尺寸、自动播放的延时等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

演示见此:http://www.iecn.net/iclass/js/ImageSlide/
打开后,右健,查看源码即可看到调用的实例。

源码如下:

/**
 * =========================================================================
 * 本程序可自由复制、修改、传播,不得删除以下信息。如用于商业用途须经原作者同意方可使用。
 * =========================================================================
 * 程序名称:ForceWindow(@iClass.JS)
 * 描  述:网页上的图片幻灯片。
 * 版  本:1.0.0
 * 创建时间:2005年4月23日
 * 修改时间:2005年4月23日
 * 作  者:钟钟
 * 邮箱地址:zhong@iecn.net
 * 版权声明:本程序属于iClass.JS,版权归作者所有。
 * 讨论地址:http://www.iecn.net/forum/showthread.php?threadid=16975
 * 有关iClass计划详见:http://www.iecn.net/forum/showthread.php?threadid=14811
 * =========================================================================
 */


//构造ImageSlide类
function ImageSlide () {
 if((/MSIE/s*[5-9]/).test(navigator.appVersion)) {
  this.count = 0;
  this.timer = null;
  this.first = new Object();
  this.frms = new Array();

  this.imgs = new Array();
  this.width = 640;
  this.height = 480;
  this.boxId = "imageSlideBox";
  this.delay = 5;
  this.autoPlay = true;
  this.transform = 23;
  /**
   * 播放切换效果说明
   * --------------
   *  0. 矩形缩小
   *  1. 矩形扩大
   *  2. 圆形缩小
   *  3. 圆形扩大
   *  4. 从下到上
   *  5. 从上到下
   *  6. 从左到右
   *  7. 从右到左
   *  8. 竖百叶窗
   *  9. 横百叶窗
   * 10. 错位横百叶窗
   * 11. 错位竖百叶窗
   * 12. 点扩散
   * 13. 两边到中间
   * 14. 中间到两边
   * 15. 中间到上下
   * 16. 上下到中间
   * 17. 右下到左上
   * 18. 右上到左下
   * 19. 左上到右下
   * 20. 左下到右上
   * 21. 横条
   * 22. 竖条
   * 23. 随机
   * --------------
   */
 }
 else {
  alert("请使用IE5或IE5以上版本的浏览器使用本程序!");
 }
}

//加入一张或多张图片(传入一个或多个图片路径)
//pushImg(sPath1 [, sPath2 [, sPath3 [, ...]]])
ImageSlide.prototype.pushImgs = function () {
 for (var i = 0; i < arguments.length; i++)
  this.imgs.push(arguments[i]);
}

//设置图片播放容器的长宽
ImageSlide.prototype.setSize = function (nWidth, nHeight) {
 this.width = nWidth;
 this.height = nHeight;
}

//设置图片播放容器的ID
ImageSlide.prototype.setBoxId = function (sBoxId) {
 this.boxId = sBoxId;
}

//设置是否自动播放
ImageSlide.prototype.setAutoPlay = function (bAutoPlay) {
 this.autoPlay = bAutoPlay;
}

//设置自动播放的延时秒数
ImageSlide.prototype.setDelay = function (nSeconds) {
 this.delay = nSeconds;
}

//设置播放的切换效果(0-23的整数)
ImageSlide.prototype.setTransform = function (nTransform) {
 this.transform = nTransform;
}

//显示
ImageSlide.prototype.display = function () {
 var boxStr = "<div style='width:" + this.width + "px;height:" + this.height + "px;' ";
 boxStr += "id='"  + this.boxId + "'><div ";
 if (this.autoPlay)
  boxStr += "onclick='window.imageSlide.play();window.imageSlide.timerPlay();'";
 else
  boxStr += "onclick='window.imageSlide.play();'";
 boxStr += "style='word-break:keep-all;width:100%;height:100%;background-color:#EEEEEE;'>";
 if (this.autoPlay)
  boxStr += "<br /> 点击此处开始进行自动播放……";
 else
  boxStr += "<br /> 点击此处开始播放,播放时单击播放下一张……";
 boxStr += "</div>";
 var img;
 var transform = this.transform;
 for (var i = 0; i < this.imgs.length; i++) {
  if (this.transform >= 23)
   var transform = Math.floor(Math.random()*23);
  boxStr += "<img src='" + this.imgs[i] + "' style='display:none;width:";
  boxStr += this.width + ";height:" + this.height + "px;height:px;filter:";
  boxStr += "revealTrans(transition=" + transform + ",duration=1);'";
  if (!this.autoPlay)
   boxStr += "' onclick='window.imageSlide.play();' alt='点击播放下一张'";
  boxStr += " />";
 }
 boxStr += "</div>";
 document.writeln(boxStr);
 var box = document.getElementById(this.boxId);
 this.first = box.childNodes[0];
 this.frms = box.getElementsByTagName("IMG");
}

//播放
ImageSlide.prototype.play = function () {
 if (window.imageSlide.imgs.length) {
  window.imageSlide.first.style.display = "none";
  if (window.imageSlide.count >= window.imageSlide.imgs.length) {
   alert("播放完毕!");
   window.imageSlide.frms[window.imageSlide.count-1].style.display = "none";
   window.imageSlide.first.style.display = "block";
   window.imageSlide.first.innerHTML = "<br /> 点击此处再次进行播放!";
   clearInterval(window.imageSlide.timer);
   window.imageSlide.count = 0;
  }
  else if (window.imageSlide.count == 0) {
   window.imageSlide.first.style.display = "none";
   window.imageSlide.frms[0].filters[0].apply();
   window.imageSlide.frms[0].style.display = "block";
   window.imageSlide.frms[0].filters[0].play();
  }
  else {
   window.imageSlide.frms[window.imageSlide.count-1].style.display = "none";
   window.imageSlide.frms[window.imageSlide.count].filters[0].apply();
   window.imageSlide.frms[window.imageSlide.count].style.display = "block";
   window.imageSlide.frms[window.imageSlide.count].filters[0].play();
  }
  window.imageSlide.count++;
 }
 else {
  alert("你没有放入任何图片,无法进行播放!");
 }
}

//连续播放
ImageSlide.prototype.timerPlay = function () {
 this.timer = setInterval(this.play, this.delay * 1000);
}

//实例化一个ImageSlide对象imageSlide并将其做为window对象的一个子对象
window.imageSlide = new ImageSlide();

 
### 关于 XEDParse.lib 的信息 XEDParse.lib 是 Intel 提供的一个库文件,通常用于解析和分析 x86 和 x86-64 指令集。它基于 Intel 的 XED(eXtensible Disassembler)工具包开发,能够提供详细的指令信息,包括操作码、寄存器使用情况以及内存访问模式等[^1]。 #### 下载 XEDParse.lib 并不是一个独立发布的库,而是作为 Intel XED 工具的一部分发布。可以通过以下方式下载完整的 XED 工具包: - 访问官方 GitHub 页面:`https://github.com/intel/xed` - 在该页面上找到最新的发行版本并下载压缩包。 - 解压后,在构建目录下可以找到预编译的静态库 `XEDParse.lib` 或动态链接库及其头文件。 #### 使用方法 要使用 XEDParse.lib,需按照以下方式进行配置和调用: 1. **引入必要的头文件** 需要在源代码中包含 XED 的核心头文件以便访问其功能接口。 ```cpp #include "xed-interface.h" ``` 2. **初始化解码环境** 初始化一个解码器实例来准备后续的操作。 ```cpp xed_decoded_inst_t xedd; xed_state_t dstate; // 处理状态对象 xed_tables_init(); // 初始化全局表数据 ``` 3. **加载目标二进制代码** 将待解析的目标机器码加载到缓冲区中,并通过指定地址范围完成实际解码过程。 ```cpp const uint8_t* itext = reinterpret_cast<const uint8_t*>(binary_code); unsigned int length = sizeof(binary_code); xed_decode(&xedd, &dstate, itext, length); ``` 4. **提取所需的信息** 利用已有的 API 函数读取关于当前指令的各种属性值。 ```cpp printf("Instruction: %s\n", xed_iclass_enum_t2str(xedd.iclass)); ``` 以上步骤展示了如何利用 XED 库中的组件来进行基本的功能实现。 #### 文档资料 Intel 官方提供了详尽的技术手册与教程指导开发者更好地理解和应用此技术栈: - HTML 版本联机帮助文档位于安装路径下的 doc/html 子目录内; - PDF 形式的综合指南同样可供离线查阅学习之便; 此外还有众多在线资源如 Stack Overflow 社区讨论帖可以帮助解决具体实践中遇到的问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值