爱易网
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 浏览次数:20212 次
以下是程序代码
<!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特效代码演示
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
PC迎9年来出货量新低 平板电脑渐成主流
迅雷欲3300万美元收购金山快盘 预计9月完成
京东很忙:升服务推产品更新招股书 能赶在阿里前上市?
微博启动自媒体计划 粉丝+收入双激励是亮点
北京电信推“0月租卡”,同网通话免费
中移动五大基地将整改成公司:被指易滋生腐败
手游市场乱象丛生 受资本热捧野蛮成长
中国首台比特币ATM登陆上海 可购买不可兑换现钞
中方抗议美方限购IT设备 紧张关系加剧
推荐阅读
更多>
打车软件“明补变暗补”背后的小算盘
墨迹也要做硬件,工具类应用如何“变异”的
迅雷高管解读财报:收购快盘可快速融入小米
三星起诉LG在冰箱广告中玷污其企业笼统
解析2014年阿里百度等五大互联网巨头深度布局
中国移动承诺再降4G资费 网络漫游至50个国家
联想国庆完成收购IBM x86服务器
从WPS到office365,中国企业能否赶超美国?
FDD牌照12月将发放 联通电信双4G反击中移动
苹果30亿美元收购Beats
纸媒深探版权蓝海抗衡互联网的时机到来了
亚马逊Fire Phone:请别拿我跟苹果三星比
京东微信入口战略能否助力618大促创流量巅峰
继续涨:微博IPO第二交易日 收盘大涨11.71%
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
英特尔技术高管离任 电视业务或受影响
谷歌新技术进入iOS平台:将叫板苹果Siri
阿里马云:我觉得互联网还有十年可以做
360涉足搜索范围 百度市场份额面临应战
云储存有多远:跨过数据安全问题即可到达