---
title: "显示全屏覆盖层"
author: "jacklan"
date: "2008-08-01T09:58:50Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2008-08-01T09:58:50Z"
id: 222613
url: "https://jacklang.iteye.com/blog/222613"
---

```java
<div id="topDiv" style="filter:alpha(opacity=30);-moz-opacity:0.5; z-index:1000 ;   position: absolute;left:0px ;top:0px; BACKGROUND-COLOR: #A5C8FC ; ">
</div>

```


```javascript

  //显示全屏覆盖层
  function showTopDiv()
  {
  		var topDiv =document.getElementById("topDiv") ;
  		topDiv.style.display="" ;
  		var winWidth=document.body.clientWidth ;
  		var winHeight=document.body.clientHeight ;
  		topDiv.style.width=winWidth ;
  		topDiv.style.height=winHeight ;
  		
  }
  //隐藏全屏覆盖层
  function hiddenTopDiv()
  {
  		var topDiv =document.getElementById("topDiv") ;
  		topDiv.style.display="none" ; 
  
  }

```