HTML鼠标悬浮显示隐藏 JS方法
CSS样式表:
@charset "utf-8";
/* CSS Document */
.a
{
width:80px;
height:40px;
top:200px;
left:200px;
background-color:#F00;
position:absolute;
overflow:hidden;
}
.b
{
width:80px;
height:120px;
top:40px;
left:0px;
position:absolute;
} .x
{
width:80px;
height:40px;
top:0px;
left:0px;
background-color:#0F0;
overflow:hidden;
position:absolute;
}
.x1
{
width:100px;
height:160px;
top:0px;
left:80px;
background-color:#0F0;
position:absolute;
}
.y
{
width:80px;
height:40px;
top:40px;
left:0px;
background-color:#00F;
overflow:hidden;
position:absolute;
}
.y1
{
width:100px;
height:160px;
top:0px;
left:80px;
background-color:#00F;
position:absolute;
}
.z
{
width:80px;
height:40px;
top:80px;
left:0px;
background-color:#F0F;
overflow:hidden;
position:absolute;
}
.z1
{
width:100px;
height:160px;
top:0px;
left:80px;
background-color:#F0F;
position:absolute;
}
源代码:
<!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=utf-8" />
<title>无标题文档</title>
<link href="Untitled-3的样式表.css" rel="stylesheet" type="text/css" />
</head> <body>
<div class="a" id="f1" onmouseover="h1()" onmouseout="h2()">
<div class="b">
<div class="x" id="f2" onmouseover="h3()" onmouseout="h4()">
<div class="x1"></div>
</div>
<div class="y" id="f3" onmouseover="h5()" onmouseout="h6()">
<div class="y1"></div>
</div>
<div class="z" id="f4" onmouseover="h7()" onmouseout="h8()">
<div class="z1"></div>
</div>
</div>
</div>
</body>
</html>
<script>
function h1()
{
document.getElementById("f1").style.overflow="visible"; }
function h2()
{
document.getElementById("f1").style.overflow="hidden";
}
function h3()
{
document.getElementById("f2").style.overflow="visible";
}
function h4()
{
document.getElementById("f2").style.overflow="hidden";
}
function h5()
{
document.getElementById("f3").style.overflow="visible";
}
function h6()
{
document.getElementById("f3").style.overflow="hidden";
}
function h7()
{
document.getElementById("f4").style.overflow="visible";
}
function h8()
{
document.getElementById("f4").style.overflow="hidden";
}
</script>
效果图:

HTML鼠标悬浮显示隐藏 JS方法的更多相关文章
- 可以兼容ie6的纯CSS三级鼠标悬停显示/隐藏菜单实现
本来在chrome上用js写的好好的三级显隐菜单,放到ie6上一测试竟然奇葩般的会瞎闪.问题原因至今没参透,可能是我每次响应事件的处理代码过长??总之我是对ie6幻灭了,去网上搜一搜能支持ie6的下拉 ...
- 基于jquery封装通用的控制显示隐藏的方法
应用场景 在项目中会存在大量这样的需求: 1.选择不同的radio单选框,页面上的部分内容随之显示隐藏 2.选择不同的option下拉框内容,页面上的部分内容随之显示隐藏 如果每次遇到这类需求都单独写 ...
- 移动端右侧导航 显示隐藏js
transform与fixed影响 html按钮 <span class="nav-btn"></span> <span class="cl ...
- Selenium之当鼠标悬浮时隐藏的元素才出现
在自动化过程中,有些导航按钮只有当鼠标悬浮在登录信息上时,它才能出现.这时候如果想要点击导航按钮直接用selenium的webDriver是无法定位的元素的,因为这些元素是隐藏的,只有鼠标悬浮时才出现 ...
- Winform中设置ZedGraph鼠标悬浮显示举例最近曲线上的点的坐标值和X轴与Y轴的标题
场景 Winform中设置ZedGraph鼠标双击获取距离最近曲线上的点的坐标值: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/ ...
- echarts —— tooltip 鼠标悬浮显示提示框属性
最近一直在使用echarts,当然也被其中的各种属性整的头大,记录一下其中遇到的问题. tooltip:鼠标悬浮时显示的提示框. 今天想要记录的是[自定义提示框的内容],如下图,鼠标悬浮时提示框内显示 ...
- datagrid 列鼠标悬浮显示全部信息
首次发表随笔,且是java新手,求不黑,可能在高手眼里好笑,嘿嘿1,样式设置超过字数限制显示省略号:<style type="text/css"> .datagrid- ...
- 使用react-tooltip实现鼠标悬浮显示框详细记录
前段时间遇到的一个需求,要求鼠标悬停显示使用描述, 用到了react-tooltip插件,今天写一个总结 先看效果(为了方便参考,用的是原始样式): 文档参考地址: https://www.npmjs ...
- JS实现鼠标悬浮,显示内容
其实就是增加title属性
随机推荐
- Linux Home目录硬盘空间缩减
Linux Home目录硬盘空间缩减 操作 基于centos6.5 x86_64, runlevel 3,命令行模式,测试成功. 1.首先查看磁盘使用情况 [root@localhost ~]# ...
- 【python】字符串函数
1.String模块中的常量: string.digits:数字0~9 string.letters:所有字母(大小写) string.lowercase:所有小写字母 string.printabl ...
- Windows网络编程经验小结
转自:CSDN网友的强贴,其ID:gdy119 (夜风微凉) 1. 如果在已经处于 ESTABLISHED状态下的socket(一般由端口号和标志符区分)调用closesocket(一般不会立即关闭而 ...
- theme为dialog的Activity如何充满全屏
转自:http://blog.csdn.net/fzh0803/article/details/9787615 分类: android_点滴记录2013-08-06 10:33 2005人阅读 评论 ...
- 小峰servlet/jsp(6)jstl核心标签库
一.引入jstl 需要jstl.jar;standard.jar; 二.jstl核心标签库: c:out 内容输出标签; c:set 用来设置4种属性范围值的标签: c:re ...
- 用Keras搭建神经网络 简单模版(二)——Classifier分类(手写数字识别)
# -*- coding: utf-8 -*- import numpy as np np.random.seed(1337) #for reproducibility再现性 from keras.d ...
- CSS 标签实例一 homepage.css
#overlayer { position: absolute; //指定一个元素(静态的,相对的,绝对或固定)的定位方法的类型. /*top: 50px;*/ left: 0; //定义了定位元素左 ...
- chronyd时间服务器同步时间配置
chrony是两个用来维持计算机系统时钟准确性的程序,这两个程序命名为chronyd和chronyc. chronyd是一个在系统后台运行的守护进程.他根据网络上其他时间服务器时间来测量本机时间的偏移 ...
- phpstorm使用教程
phpstorm包含了webstorm的全部功能,更能够支持php代码.PhpStorm是一个轻量级且便捷的PHP IDE,其旨在提供用户效率,可深刻理解用户的编码,提供智能代码补全,快速导航以及即时 ...
- PHP MySQL Order By
ORDER BY 关键词用于对记录集中的数据进行排序. ORDER BY 关键词 ORDER BY 关键词用于对记录集中的数据进行排序. ORDER BY 关键词默认对记录进行升序排序. 如果你想降序 ...