星空网 > 软件开发 > Java

js 横幅播放

js 横幅播放

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html ="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript">/*  (1)网页加载完成,图片开始轮换  (2)图片循环显示,需要用到定时器  (3)将构建的src的新值,重新写入到id=img0的对象中去*/var i = 1;//全局变量function swapImg(){  i++;//第一次因为已经有一张图片显示了,第一遍应该从2开始,第二遍循环应该1开始  //先取到id=img0的对象  var obj = document.getElementById("img0");  var str = "images/dd_scroll_"+i+".jpg";  //修改id=img0对象的src属性的值  obj.src = str;  //条件判断  if(i>=6)  {    i= 0;  }}function start(){  //setInterval()重复执行  window.setInterval("swapImg()",1000);}</script></head><body onload="start()"><img id="img0" src='/images/loading.gif' data-original="images/dd_scroll_1.jpg" /></body></html>

 




原标题:js 横幅播放

关键词:JS

JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Flummox:https://www.goluckyvip.com/tag/20480.html
Flutterwave:https://www.goluckyvip.com/tag/20481.html
Flybuys:https://www.goluckyvip.com/tag/20482.html
FLYNOVA:https://www.goluckyvip.com/tag/20483.html
Flywheel:https://www.goluckyvip.com/tag/20484.html
Flywheel Digital:https://www.goluckyvip.com/tag/20486.html
恐怖游轮2002 恐怖游轮2022:https://www.vstour.cn/a/365178.html
时尚电商平台Meesho拟融资3亿美元!:https://www.kjdsnews.com/a/1836524.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流