IE6下select被这罩住
在我们做弹出遮罩层时经常遇到这种问题,就是select被这罩住不兼容IE6,其实解决这种问题并不难,只要掌握住原理就挺简单的。
首先就是当遮罩层出现时select要暂时隐藏,但是不能用display:none;
要用visibility:hidden;这样select的虽然隐藏但位置还在。
下面是js代码:
<script language="javascript">
function f(o){
o.style.display = "none";
document.getElementBy Id("hidediv").style.display = "";
var sels = document.getElementsBy Tag Name("SELECT");
for(var i=0; i<sels.length; i++){
sels[i].style.visibility = "hidden";
}
}
</script>
下面是html代码:
<div><select style="margin:10px 0 0 200px"><option>IE6下select被这罩住</option></select>
</div>
<div><select style="margin:10px 0 0 200px"><option>IE6下select被这罩住</option></select>
</div>
<div><select style="margin:10px 0 0 200px"><option>IE6下select被这罩住</option></select>
</div><div id="hidediv" style="display:none;position: absolute; z-index:100; left: 0px; top: 0px; background:#000; width: 100%; opacity: 0.3;filter:Alpha(opacity=30); height: 2000px;">
<iframe style="width:100%;height:100%;filter:Alpha(opacity=0);" border="0" frameborder="0"></iframe>
</div>
<button onclick="f(this);">显示遮罩层</button>
IE6下select被这罩住的更多相关文章
- 解决IE6下select显示在弹出框上问题
利用定位position:absolute;z-index:1;和iframe[z-index:-1]来解决此问题,最好根据需要加上: border='0' frameborder='0' scrol ...
- 完美解决该死的ie6下select总是置于最上层bug
<html> <head> <meta http-equiv="Content-Type" content="text/html; char ...
- IE6下div层被select控件遮住的问题解决方法
Select在IE6下是处于最顶层的,因此想要遮住它,设置zIndex属性是不行的,就需要一个优先级更高的元素,就是iframe,当把iframe嵌套在弹出div层中后,把iframe设置为不可见,但 ...
- IE6下div遮盖select的最优解决方案
a.本节精选html5/css频道里一款IE6下div遮盖select的最优解决方案 原理:利用iframe来遮挡select,再用div来遮挡iframe,就这么简单. 1)首先,建一个div层和i ...
- IE6下解决select层级高的问题
div在IE6下无法遮盖select,原因是在IE6下,浏览器将select元素视为窗口级元素,这时div或者其它的普通元素无论z-index设置的多高都是无法遮住select元素的. 解决方法有三种 ...
- 【jquery】jquery 在 ie6 下无法设置 select 选中的解决方法
本文主要解决在 ie6 下,jquery 无法设置 select 选中的问题.我们先看个例子: <!DOCTYPE HTML> <html lang="en-US" ...
- IE6下png格式图片显示问题
一开始是使用 _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bgBtn.png'); /* IE6 * ...
- 疯狂抨击ie6下各种扭曲行为
从开始接触ie6就被它强大的力量给震住了,虽然它很可怕,但是我总归得想方设法把它给扼杀在摇篮外.以下是我在ie6下面碰到的一些扭曲行为,弱弱的把它给干掉!!! 1.浮动下margin翻倍问题(很典型, ...
- ie6下固定位置的实现
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
随机推荐
- Spark简介安装和简单例子
Spark简介安装和简单例子 Spark简介 Spark是一种快速.通用.可扩展的大数据分析引擎,目前,Spark生态系统已经发展成为一个包含多个子项目的集合,其中包含SparkSQL.Spark S ...
- Study 7 —— CSS美化背景和边框
图片透明度属性:opacity 背景图片重复属性:background-repeat背景图片位置属性:background-position background-postion:横坐标 纵坐标; b ...
- BIO | NIO | AIO (Java版)
几篇解释的不错的文章: BIO NIO AIO NIO.2 入门,第 1 部分: 异步通道 API 使用异步 I/O 大大提高应用程序的性能
- Js/Jquery 关闭 离开或刷新当前页面时提醒,和执行解绑取消提醒
如图,现在的 cnblogs 或者QQ邮箱编辑页面,刷新.关闭提醒: <script src="../../Common/Js/jquery-1.8.1.min.js"> ...
- linux系统--用户和用户组
一.用户和用户组的概念 用户:使用操作系统的人 用户组:具有相同系统权限的一组用户.在linux系统中可以存在多个用户组 1.1 /etc/group 这里存储当前系统中所有用户组的信息 每一行对应一 ...
- VC++中LogFont设置字体(转)
LOGFONT是Windows内部字体的逻辑结构,主要用于设置字体格式,其定义如下:typedef struct tagLOGFONTA{LONG lfHeight;LONG lfWidth;LONG ...
- C# 面向对象的base的使用
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...
- [C++]埃拉托色尼算法
/* 埃拉托色尼算法 问题描述:定义一个正整数n,求0-n范围以内的所有质数 @date 2017-03-06 @author Johnny Zen */ #include<iost ...
- cpp与其他语言相比较
new 相当于 malloc ,delete 相当于 free ,用法一样 c++ 有 namespace,可以避免类名污染 namespace xx{} c++ 有类 这个与 c#.as3比较 ...
- 第18月第10天 iOS11 uicollectionview
1. - (void)collectionView:(UICollectionView *)collectionView willDisplaySupplementaryView:(UICollect ...