爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
仿FLASH的漂亮的图片轮播效果
仿FLASH的漂亮的图片轮播效果
日期:2014-05-18 浏览次数:20210 次
以下是HTML网页特效代码,点击运行按钮可查看效果:
以下是程序代码
<?xml version="1.0" encoding="gb2312"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"> <head> <title>JS图片特效</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="generator" content="editplus" /> <meta name="author" content="eLore" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <style type="text/css"> * { margin:0; padding:0; } body { margin:5px auto; text-align:center; background:#f0f0f0; } img { margin:0; border:0; padding:0; } #eLore { position:relative; margin:0 auto; width:800px; height:339px; } #eLore_wrap { position:relative; margin:0 auto; overflow:hidden; width:400px; height:200px; background:#369; z-index:5; } #eLore .eLore_img { position:absolute; top:0; overflow:hidden; } #eLore .eLore_out { position:absolute; right:0; top:0; overflow:hidden; } </style> </head> <body> <div id="eLore"> <div id="eLore_wrap">Loading...</div> </div> <div id="debug"></div> <script type="text/javascript"> //<[CDATA[ var eLore_wrap = document.getElementById('eLore_wrap'); var iImg = 0; var iA = 0; var aImg = [ 'http://gg.blueidea.com/2008/blueidea/job2.gif', 'http://gg.blueidea.com/2008/blueidea/job.gif', 'http://gg.blueidea.com/2008/blueidea/job2.gif', 'http://gg.blueidea.com/2008/blueidea/job.gif' ]; var iImgWidth = 317, iImgHeight = 104; var iDivWidth = iImgWidth/10; eLore_wrap.style.width = 10*(Math.floor(iImgWidth/10)) + 'px'; eLore_wrap.style.height = iImgHeight + 'px'; eLore_createD(); function eLore_createD() { if (iImg==10) { eLore_wrap.innerHTML = ''; iImg = 0; } if (iImg==0) { var oDivOut = document.createElement('div'); oDivOut.className = 'eLore_out'; oDivOut.style.width = iDivWidth + 'px'; oDivOut.style.height = iImgHeight + 'px'; oDivOut.style.background = 'url(' + aImg[iA] + ') -' + parseInt(8.5*iDivWidth) + 'px top no-repeat'; eLore_wrap.appendChild(oDivOut); } var oDiv = document.createElement('div'); oDiv.className = 'eLore_img'; oDiv.style.right = iImg*iDivWidth +'px'; oDiv.style.width = 1.5*iDivWidth + 'px'; oDiv.style.height = iImgHeight + 'px'; oDiv.style.background = 'url(' + aImg[iA] + ') -' + 9*iDivWidth + 'px top no-repeat'; eLore_wrap.appendChild(oDiv); iImg++; eLore_move(); } function eLore_move(){ var oDiv = eLore_wrap.getElementsByTagName('div'); for (var i=1; i<oDiv.length; i++) { var iBgpx = parseInt(oDiv[i].style.backgroundPosition); if (iBgpx<i*iDivWidth-(iImgWidth-0.5*iDivWidth)) { var iMovePx = Math.floor((iImgWidth-0.5*iDivWidth-i*iDivWidth+iBgpx)/15); oDiv[i].style.backgroundPosition = iBgpx - iMovePx + 'px top'; } else { oDiv[i].style.backgroundPosition = ((i+0.5)*iDivWidth-iImgWidth) + 'px top'; } } //document.getElementById('debug').innerText = eLore_wrap.innerHTML; if (iImg<10) { setTimeout('eLore_createD()','60'); } else if (parseInt(oDiv[10].style.backgroundPosition)<0.5*iDivWidth) { setTimeout('eLore_move()','60'); } else { iA = ++iA==aImg.length ? 0 : iA; setTimeout('eLore_createD()','2000'); } } //]]> </script> </body> </html></font> <a href="http://js.aiyiweb.com/">欢迎访问爱易网网页特效代码站,js.aiyiweb.com</a>
上一篇:狡猾的按钮特效
下一篇:仿土豆网首页焦点图片切换效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
PC迎9年来出货量新低 平板电脑渐成主流
互联网情色众多 Facebook与9158态度大不同
联想架构调整后:Think品牌或推智能手机
运营商补贴减少 国内通信业拐点逼近
传搜狗估值12亿美元 与360谈判进入白热化
传谷歌开发者大会发布Android 4.3 并非5.0版本
乐视28日发布手机进展 LeUI系统Mobile版或曝光
中移动“重启”自有品牌手机成败难料
QQ空间与微信龟兔赛跑,商业生态链陷入死循环
推荐阅读
更多>
美国电影协会在华起诉迅雷侵权 要求赔偿并道歉
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
迪信通神秘免费服务揭谜底:充电宝免费带回家
奇虎360证明了“惟平台化才能生存”是谬论,中国互联网不能少了周鸿祎
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
谷歌董事长成花花公子:情史足以媲美涂鸦
猎豹移动上市押海外市场 与小米有合作空间
三问刘强东:京东为何近来火气这么大?
京东联席董事长赵国庆上市前夕离职
充斥着假消息负能量的“秘密”缺乏普适性
一个非脑残米粉的思考:小米“成功之道”如何炼成
阿里巴巴上市后雅虎将面临更大的业绩压力
9月1日起免征新能源汽车购置税
微软最后的救命稻草Win 8份额继续上升
玩游戏式的趣味戒烟App:Kwit
同程旅游融资后变土豪 如何烧钱占领市场?
团购网站存活率仅18.6% 剩余缺乏千家
据消息传百度将要控股携程 整合去哪儿
中移动业绩增长趋缓 目光转向海外市场