爱易网
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 浏览次数:20261 次
以下是程序代码
<!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特效代码演示
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
阿里国际化再落子:2.49亿美元投资新加坡邮政
快播灭了,还有西瓜:视频网站的灰色江湖还在
从3G牌照发放看中国4G规划效果
韩国研制无线充电系统:一次可充40部手机
微软张亚勤趋势判断:未来三十年属于物理化互联网
中电信国际漫游费下调85% 世界杯上网28元/天
诺基亚若没加入微软,只不过是另一个HTC而已
O2O成"唐僧肉":百度糯米抢食第一口令阿里腾讯颤抖
京东物流"最后一公里":颠覆阿里或者被阿里干掉
推荐阅读
更多>
猎豹移动上市押海外市场 与小米有合作空间
马云的SNS之梦有了新目标 收购“微博”
网络旅行游记被曝插入"软广告" 个别人士月入数万
火一把就死: 百度魔图验证社交游戏衰亡宿命
网络文学竞争白热化 百度多酷文学网上线
继续涨:微博IPO第二交易日 收盘大涨11.71%
苹果MacBook Air劣势渐显 或推新产品改变命运
特斯拉将获上海免费牌照 充电桩面临双重标准
美剧讲硅谷创业者:远不及现实荒诞?
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
打车软件“明补变暗补”背后的小算盘
苏宁双线同价遇难题:第一个吃螃蟹不轻松
中移动本月推手机钱包 iPhone遭边缘化
第二梯队也PK:当1号店“遇上”京东手机节
微软很“捉急”:补贴Win8 重加末尾按钮
京东联席董事长赵国庆上市前夕离职
富士康欲用机器人产iPhone 6
170号码扎堆上市:手机话费私人定制时代到来?
联想架构调整后:Think品牌或推智能手机
华为变阵:任正非调整三大业务布局