【前端丨学习笔记】js实现鼠标经过弹出提示层
[HTML] 纯文本查看 复制代码 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标移到文字上弹出提示层</title>
<style type="text/css">
.box {
display: none;
width: 315px;
height: auto;
background: #FFFFDF;
border: 1px solid #333;
padding: 12px;
text-align: left;
position: absolute;
}
</style>
<script type="text/javascript" language="javascript">
function display() {
document.getElementById("box").style.display = "block";
}
function disappear() {
document.getElementById("box").style.display = "none";
}
</script>
</head>
<body>
<a href="#">鼠标经过这里</a>
<div id="box" class="box">鼠标经过弹出这句话:苏飞论坛欢迎你!</div>
</body>
</html>
显示效果:
|