JS——覆盖显示,点击显示三层
- <!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>
- <style type="text/css">
- *
- {
- margin:0px;
- padding:0px;
- }
- .all
- {
- width:310px;
- height:50px;
- border:#03F 1px solid;
- }
- .left
- {
- width:250px;
- height:50px;
- border:#F00 1px solid;
- }
- .right
- {
- width:50px;
- height:50px;
- border:#0F3 1px solid;
- background-color:#CCC;
- margin-left:255px;
- }
- .yincang
- {
- height:200px;
- width:200px;
- border:#30F 1px solid;
- background-color:#06F;
- margin-top:30px;
- visibility:hidden;
- }
- </style>
- </head>
- <body>
- <div class="all">
- <div class="left">
- <div class="right" onmouseover="xianshi()" onmouseout="yincang()">>><div class="yincang" id="right"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- function xianshi()
- {
- var a =document.getElementById("right");
- if(a.style.visibility="hidden")
- {
- a.style.visibility="visible";
- }
- }
- function yincang()
- {
- var b =document.getElementById("right");
- if(b.style.visibility="visible")
- {
- b.style.visibility="hidden";
- }
- }
- </script>
- <!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>
- <style type="text/css">
- *
- {
- margin:0px;
- padding:0px;
- }
- .diyiceng
- {
- width:500px;
- height:300px;
- border:#9C6 1px solid;
- margin:-300px 0px 0px 100px;
- background-color:yellow;
- visibility:visible;
- }
- .dierceng
- {
- width:500px;
- height:300px;
- border:#9C6 1px solid;
- background-color:green;
- visibility:hidden;
- margin-left:100px;
- }
- .disanceng
- {
- width:500px;
- height:300px;
- border:#9C6 1px solid;
- margin-top:-300px;
- margin-left:200px;
- background-color:blue;
- visibility:hidden;
- }
- </style>
- </head>
- <body>
- <div style="width:600px; height:300px; border:#00F 1px solid">
- <div style="width:100px; height:300px; border:#F00 1px solid">
- <input type="button" value="第一层" onclick="xianshiyi()"/><br />
- <input type="button" value="第二层" onclick="xianshier()"/><br />
- <input type="button" value="第三层" onclick="xianshisan()"/>
- </div>
- <!--第一层为黄色 第二层为绿色 第三层为蓝色-->
- <div class="diyiceng" id="diyiceng">
- <div class="dierceng" id="dierceng"></div>
- <div class="disanceng" id="disanceng"></div>
- </div>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- function xianshiyi()
- {
- var a = document.getElementById("dierceng");
- var b = document.getElementById("disanceng");
- var c = document.getElementById("diyiceng");
- if(c.style.visibility="hidden")
- {
- c.style.visibility="visible";
- a.style.visibility="hidden";
- b.style.visibility="hidden";
- }
- }
- function xianshier()
- {
- var a = document.getElementById("dierceng");
- var b = document.getElementById("disanceng");
- if(a.style.visibility="hidden")
- {
- a.style.visibility="visible";
- b.style.visibility="hidden";
- }
- }
- function xianshisan()
- {
- var b=document.getElementById("disanceng");
- if(b.style.visibility="hidden")
- {
- b.style.visibility="visible";
- }
- }
- </script>
JS——覆盖显示,点击显示三层的更多相关文章
- js如何实现点击显示和隐藏表格
js如何实现点击显示和隐藏表格 一.总结 一句话总结: 1.给table或者table里面的元素添加点击事件, 2.然后判断当前表格的数据显示或者隐藏, 3.然后通过display属性显示(非none ...
- 基于js原生封装的点击显示完整文字
基于js原生封装的点击显示完整文字 (function(window) { var inner = ''; var showCont_s = function(ele) { this.init.app ...
- JS点击显示隐藏内容
JS点击显示隐藏密码 思路:获取元素,判断点击,如果DIV显示就隐藏,如果DIV隐藏就显示出来. 1 if(DIV是显示的){ 2 div.style.display='none'; 3 } 4 el ...
- js点击显示隐藏
这个栗子…… 可以不吃,先预设一个变量表示div的状态,例子中0是显示的,一开始是隐藏的.当点击时判断状态是显示0的还是隐藏1的:如果是显示的就把div隐藏,再把变量改变为1.再次点击时把会判断到变量 ...
- Firebug中调试中的js脚本中中文内容显示为乱码
Firebug中调试中的js脚本中中文内容显示为乱码 设置 页面 UFT-8 编码没用, 解决方法:点击 "Firebug"工具栏 中的"选项"---" ...
- jQuery 点击显示再次点击隐藏
<html> <head> <script type="text/javascript" src="/jquery/jquery.js&qu ...
- HTML5--》点击显示隐藏内容
<details>浏览器支持比较差,可以用JavaScript实现这种功能. <!doctype html> <html> <head> <met ...
- 基于Jquery UI的autocompelet改写,自动补全控件,增加下拉选项,动态设置样式,点击显示所有选项,并兼容ie6+
Jquery UI的autocompelete改写 注意:实现功能,除了原版的自动补全内容外,增加一个点击显示所有选项,样式能动态设置. 加载数据的来源为后台数据库读取. 具体代码如下: 引用 从官方 ...
- jQuery - 制作点击显示二级菜单效果
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- JS 弹出网页 (不显示地址栏,工具栏) 网页去掉地址栏
JS 弹出网页 (不显示地址栏,工具栏) 网页去掉地址栏 window.open()支持环境: JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 基本语法: ...
随机推荐
- sqlserver中事务总结:begin tran,rollback tran,commit tran
第1个相关用法:摘自:https://shiyousan.com/post/f13d29b7-0d87-4168-bd8b-8b28b0991b5a 以下是出现错误的SQL部分语句: 此错误的原因是 ...
- Fedora 中的容器技术:systemd-nspawn
本文将说明你可以怎样使用 Fedora 中各种可用的容器技术和学习“systemd-nspawn”的相关知识. 容器是什么? 一个容器就是一个用户空间实例,它能够在与托管容器的系统(叫做宿主系统)相隔 ...
- php.in
[PHP] ;;;;;;;;;;; ; WARNING ; ;;;;;;;;;;; ; This is the default settings file for new PHP installati ...
- 一般源码安装添加的GD库 是不支持 jpeg 格式的图片的
一般源码安装添加的GD库 是不支持 jpeg 格式的图片的,只支持如下格式 GD Support enabled GD Version bundled (2.0.34 compatible) GIF ...
- redis常用配置参数详解
Redis 支持很多的参数,但都有默认值. daemonize 默认情况下, redis 不是在后台运行的,如果需要在后台运行,把该项的值更改为 yes. pidfile 当 Redis 在后台运行的 ...
- CentOS修复grub
grub启动项损坏无法进入系统. 进入grub模式(可借助安排盘rescue后在shell中输入grub). 一: 通过下面三个命令中的一个.找到正确的grub位置. 1. find ...
- CodeIgniter 2.X 于 PHP5.6 兼容错误
本篇文章由:http://xinpure.com/codeigniter-2-x-to-php5-6-compatible-error/ CI 3.0 已兼容此问题 在代码迁移的过程中,遇到了一个 P ...
- PHP使用file_put_contents写入文件的优点
本篇文章由:http://xinpure.com/advantages-of-php-file-write-put-contents-to-a-file/ 写入方法的比较 先来看看使用 fwrite ...
- 【转帖】Servlet 3.0 新特性详解
http://www.ibm.com/developerworks/cn/java/j-lo-servlet30/ Servlet 3.0 新特性概述 Servlet 3.0 作为 Java EE 6 ...
- 部署NopCommerce商城系统问题整理
NopCommerce是一个很棒的开源商城系统,下面整理一下我在部署使用NopCommerce系统中的一些问题. 我使用的是NopCommerce3.9版本. 1.安装 安装教程网上很多,这里不细说, ...