HTML/CSS“弹出"窗口;窗口和禁用的背景 [英] HTML/CSS "Pop-Up" Window and Disabled Background
问题描述
不幸的是,这是一个愚蠢的问题,因为我无法找到合适的关键字来通过搜索Google来获得答案.
This is a silly question since I can't find the right keywords to use to get the answer by searching Google, unfortunately.
您知道单击链接时背景变暗并变得不可用,但是前景通常具有图像或登录框吗?就像Yahoo邮件图像显示方法那样,背景中的所有内容都变为灰色透明并且图像本身就很好了?
You know when you click a link and the background dims and becomes unusable but the foreground either has an image or a sign-in box usually? Like the Yahoo mail image displaying method where everything in the background becomes grey transparent and the image itself is just fine?
那是怎么做的?叫什么?
How is that done? And what is it called?
推荐答案
这是通过在JS中动态创建覆盖div来完成的,例如:
it's done by creating an overlaying div on the fly in JS, like:
var gab = document.createElement('div');
gab.setAttribute('id', 'OVER');
gab.innerHTML='<div class="overlay"><h1>hello</h1></div>';
document.body.appendChild(gab);
使用类似CSS的类
#OVER{width:100%; height:100%; left:0;/*IE*/ top:0; text-align:center; z-index:5; position:fixed; background-color:#fff;}
.overlay {width:100%; z-index:6; left:0;/*IE*/ top:30%; font-color:#cdcdcd; font-size:0.8em; text-align:center; position:fixed; background-color:#000;}
不知道它怎么称呼..
dunno how it's called ..
这篇关于HTML/CSS“弹出"窗口;窗口和禁用的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!