爱易网
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 浏览次数:20218 次
以下是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>
上一篇:狡猾的按钮特效
下一篇:仿土豆网首页焦点图片切换效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
墨迹天气:产品创新以攻为守方能对抗巨头
HTC以品牌营销突围 专家建议改变经营思路
索尼移动中国区陷裁员风波:业务不佳 员工焦虑
清点:罗永浩推锤子ROM 小米打法遭模拟
亚马逊宣布新春大促策略 欲打造另一个"黑五"
继续涨:微博IPO第二交易日 收盘大涨11.71%
传诺基亚Lumia928下月推出 将与iPhone5看齐
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
刘强东:京东上市融资用于开拓三至六线城市
推荐阅读
更多>
京东微信入口战略能否助力618大促创流量巅峰
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
工商总局开查电商“七日退货”
一大波智能路由器正在袭来:小米、360、极路由大PK
扎克伯格华裔妻子首度亮相电视节目畅谈情史
微软张亚勤趋势判断:未来三十年属于物理化互联网
总部大楼已换微软Logo:回忆诺基亚的兴衰史
Facebook以“人”为本的名义占领安卓
阿里巴巴450亿勾画“现代服务业”藏宝图
阿里巴巴上市后雅虎将面临更大的业绩压力
谷歌新技术进入iOS平台:将叫板苹果Siri
三大运营商获通知大减营销费 传3年减400多亿
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
联通丹东公司一高管造假套出手机变卖被判刑7年
搜狐与奇虎360或结盟对抗BAT
微信将商场O2O战火烧到了阿里巴巴老家
孙正义入股阿里往事还原:阿里巴巴并非软银首选
iOS7拖累iPad 5、iPad mini2发布 传十月份推出
百度透露无人驾驶战略 研发三维交通地图
雷军收买腾讯金山股份:持股比例升至27%