运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<title>简洁实用的图片文字说明效果</title>
5
<meta http-equiv="content-type" content="text/html;charset=gb2312">
6
<style type="text/css">
7
#oimg{float:left;margin:10px;}
8
#msg{border:solid;width:200px;height:90px;display:none;float:left;padding:10px;}
9
</style>
10
</head>
11
<body>
12
<img id="oimg" src="//ku.shouce.ren/files/images/201601/56a31851907c3.jpg">
13
<div id="msg">难忘北欧……</div>
14
<script type="text/javascript">
15
var oid=document.getElementById('oimg');
16
var omsg=document.getElementById('msg');
17
var timer=null;
18
oid.onmousemove=showMsg;
19
oid.onmouseout=hideMsg;
20
omsg.onmouseout=hideMsg;
21
omsg.onmousemove=function(){clearTimeout(timer)};
22
function showMsg(){if(timer){clearTimeout(timer)}omsg.style.display='block';}
23
function hideMsg(){timer=setTimeout(function(){omsg.style.display='none';},500);}
24
</script>
25
</body>
26
</html>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
简洁实用的图片文字说明效果
分类
表格图层
描述
简洁实用的图片文字说明效果,当鼠标滑过图片的时候,会显示出文字提示,用于图片的说明性文字比较合适了,另外这种层效果确实很不错的,希望大家喜欢。
收藏