爱易网
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特效
模拟网易的一个鼠标悬停在图片上显示文字提示的特效代码
模拟网易的一个鼠标悬停在图片上显示文字提示的特效代码
日期:2014-05-18 浏览次数:20225 次
以下是程序代码
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>面向对象</title> <style type="text/css"> <!-- body {font-size: 14px;line-height: 24px;margin: 0px;padding: 0px;} ul,li{margin:0px;padding:0px;list-style-type:none;} img{border:0px;} h3,p{margin:0px;padding:0px;} h3{margin-top:50px;} #show{width:724px;height:364px;border:#ccc 1px solid;margin:10px;overflow: hidden;} li{float:left;margin-top:1px;margin-left:1px;height:180px;width:240px;overflow: hidden;} #show .alt{position: absolute;background:#000;display:none;text-align:center;} a,a:hover{color: #FFFFFF;text-decoration: none;} --> </style> <script type="text/javascript"> function $(id){return typeof id === "string" ? document.getElementById(id) : id;} function $$(oParent, elem){return (oParent || document).getElementsByTagName(elem);} function imgLight(id) { this.oDiv=$(id); this.oImg=$$(oDiv,"img"); this.oLi=$$(oDiv,"li"); this.oView=function(Obj) { var iMain=Obj; var iSpeed=1; var timer=null; iMain.onmouseout=function(){oClose(this);} timer=setInterval(function(){ iMain.style.filter='alpha(opacity='+iSpeed+')'; iMain.style.opacity=iSpeed/100; iSpeed+=1; if(iSpeed>=60){clearInterval(timer);} },1); } this.oClose=function(Obj) { var oMain=Obj; var oSpeed=60; var otimer=null; otimer=setInterval(function(){ oMain.style.filter='alpha(opacity='+oSpeed+')'; oMain.style.opacity=oSpeed/100; oSpeed-=1; if(oSpeed<=0){clearInterval(otimer);oMain.style.display="none";}; },1); } for(var i=0;i<oLi.length;i++) { var oThis=oLi[i]; oThis.onmouseover=function() { var oWidth=$$(this,"img")[0].offsetWidth; var oHeight=$$(this,"img")[0].offsetHeight; this.firstChild.style.width=oWidth+"px"; this.firstChild.style.height=oHeight+"px"; this.firstChild.style.display="block"; oView(this.firstChild); } oThis.onclick=function() { window.location=$$(this.firstChild,"a")[0].href; } } } window.onload=function() { var newImg=imgLight("show"); } </script> </head> <body> <div id="show"> <ul> <li><div class="alt"><a href="http://bbs.blueidea.com"><h3>第一幅</h3><p>好久不见的向日葵</p></a></div><img src="http://aihushan.com/pic/1.jpg" width="240" height="180" /></li> <li><div class="alt"><a href="http://bbs.blueidea.com"><h3>第二幅</h3><p>纯手工雕刻的哦</p></a></div><img src="http://aihushan.com/pic/2.jpg" width="240" height="180" /></li> <li><div class="alt"><a href="http://bbs.blueidea.com"><h3>第三幅</h3><p>小桥流水人家</p></a></div><img src="http://aihushan.com/pic/3.jpg" width="240" height="180" /></li> <li><div class="alt"><a href="http://bbs.blueidea.com"><h3>第四幅</h3><p>又一幅小桥流水人家</p></a></div><img src="http://aihushan.com/pic/4.jpg" width="240" height=&qu
上一篇:狡猾的按钮特效
下一篇:js仿jquery插件lightBox特效代码演示
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
高通拼抢国际芯片市场 联发科海外拓展难安心
苹果MacBook Air劣势渐显 或推新产品改变命运
微软张亚勤趋势判断:未来三十年属于物理化互联网
HTC曝出特大丑闻:高管诈骗+商业间谍
Skype周年:与微软联姻到底有没有未来?
马云自称在美国曾被绑票
孙正义入股阿里往事还原:阿里巴巴并非软银首选
“论文查重”网店一月收入竟过百万
史玉柱谈创业:5大建议 失败的教训最真实
推荐阅读
更多>
阿里国际化再落子:2.49亿美元投资新加坡邮政
阿朗力避步北电后尘 急切停止自我革新
苹果6月20日发布iPhone5S 触摸屏概念股生动
微软大幅调整Bing在华策略:从高大上到接地气
广电总局回应美剧下架:不是所有信息可公开
腾讯微信昨晚再现大规模故障 多地受到影响
微信将商场O2O战火烧到了阿里巴巴老家
三问刘强东:京东为何近来火气这么大?
广电地方营业厅的一句“罚停”,暴露出了他们的本质
首批四款“官方”打车软件发布:均为安卓版本
联发科享用价钱战 专利难以摆脱高通
富士康人事故骚动方寸 不惜血本下注电商
FDD牌照12月将发放 联通电信双4G反击中移动
中电信国际漫游费下调85% 世界杯上网28元/天
优酷土豆携手新浪微博 谋攻移动视频失地
OPPO创始人陈明永:我们是怎么做营销的
百度透露无人驾驶战略 研发三维交通地图
京东联席董事长赵国庆上市前夕离职
中国雅虎邮箱今日关停 由盛及衰的背后
永不磨灭的九大尖端编程语言