爱易网
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 浏览次数:20273 次
以下是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>
上一篇:狡猾的按钮特效
下一篇:仿土豆网首页焦点图片切换效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
中移动落马高管盘点:广东移动成反腐重地
搜狐前副总编何毅加盟乐视 任车联网公司CEO
历史惊人相似:如今的库克 曾经的鲍尔默
京东物流"最后一公里":颠覆阿里或者被阿里干掉
解析2014年阿里百度等五大互联网巨头深度布局
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
喜大普奔:2016年国内乘客有望在飞机上使用手机
中移动本月推手机钱包 iPhone遭边缘化
苹果20年以来首次发债 融资170亿美元
推荐阅读
更多>
京东微信入口战略能否助力618大促创流量巅峰
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
玩游戏式的趣味戒烟App:Kwit
网曝富士康“二连跳” 疑因推静音模式
原万网CTO周雷加盟亿玛 出任CTO一职
虚拟运营商前路迷茫 业界建议发力车联网
腾讯为何在与阿里百度的收购比赛中当看客?
奇虎360证明了“惟平台化才能生存”是谬论,中国互联网不能少了周鸿祎
中兴通讯不打机海战术 将向中高端手机转型
2018年阿里云双11活动如何参加?1折优惠大攻略
2018双11阿里云老用户怎么参加拼团活动 老用户拼团方法
iPhone5S组件曝光 印证杀手级功能存在
Facebook以“人”为本的名义占领安卓
FDD牌照短期不会发放 联通电信暗自提速建网
电信运营商员工涌入虚拟运营商,待遇差距多大?
华为坚持不上市究竟为何?不差钱也不想冒风险
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
黑莓高管:黑莓能作为家“小众公司”活下来
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
特斯拉技术专利开放,要革自己的命?