爱易网
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 浏览次数:20195 次
以下是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>
上一篇:狡猾的按钮特效
下一篇:仿土豆网首页焦点图片切换效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
三星手机在国内陷入困境:华为中兴小米紧追
美国电影协会在华起诉迅雷侵权 要求赔偿并道歉
P2P平台科迅网疑“跑路” 涉及金额超2700万
京东确定IPO定价区间 最高募资16.9亿美元
苹果已经允许开发者提交64位应用程序
微软最后的救命稻草Win 8份额继续上升
英特尔IDF峰会启示:释放移动互联的信号
互联网情色众多 Facebook与9158态度大不同
为啥苹果定要出廉价iPhone?都是安卓逼的
推荐阅读
更多>
埃里克杰克森:阿里IPO估值至少1500亿美元
神州泰岳雪上加霜:副总违规买卖遭罚
固话上网卡或将实名制 运营商泄露用户信息将被罚
工信部或本月17日向联通电信颁发FDD牌照
华为坚持不上市究竟为何?不差钱也不想冒风险
网络旅行游记被曝插入"软广告" 个别人士月入数万
戴尔新CEO名单曝光:惠普甲骨文高管在列
英特尔涉嫌垄断 欧盟或开出史上最高罚单
网络音乐非片面收费 高晓松时间表难完成
说说这一个月的赌球输了多少
中移动“重启”自有品牌手机成败难料
虚拟运营市场躁动:山西煤老板兴味浓重
搜狐前副总编何毅加盟乐视 任车联网公司CEO
三星已经将Galaxy S5视为失败之作?
联通丹东公司一高管造假套出手机变卖被判刑7年
2018年阿里云双11活动如何参加?1折优惠大攻略
苏宁双线同价遇难题:第一个吃螃蟹不轻松
靠价格战赚取资费套餐利润差,虚拟运营商必死无疑
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
三星起诉LG在冰箱广告中玷污其企业笼统