开心网中,每当点击种菜或车位时显示画面总是出现蒙版效果,还有记数的显示效果。这是怎么实现的?csdn中提示结帖的显示也有蒙版的出现,这是怎么实现的?

解决方案 »

  1.   

    就是一个层,设置了透明度,将当前的页面大小全部遮蔽起来,z-index设置的很高,show出来就可以了....然后另外一个层,上面有内容,比如登陆什么的,z-index比前面的遮蔽层高一点点,居中,就o了...
      

  2.   

    简单点就是一div层,设置了css样式,不过现在这种AJAX技术一般都有现成模板了
      

  3.   

    打开你的IE,选择Internet Options->Advanced->Disable script debugging(Internet Explorer)然后打开你强大的VS,开始debugger吧。
      

  4.   

    这个用样式控制的透明度,你程序该怎么写还是怎么写,让美工把你显示数据的DIV样式改改就实现了
      

  5.   

    给你看个简单明了的 -)
    http://www.cnblogs.com/zhouweiwei/archive/2009/11/25/1610786.html
      

  6.   

    新建个文本文档,拷贝下面代码,改后缀成html,用IE打开
    点下按钮就能看到现象<html>
    <head>
    <style>
    body{
    font-size:12px;
    }
    </style>
    <script type="text/javascript" language="javascript">
    function divShow(tip){
    var bgWidth,bgHeight;
    var msgWidth=300;
    var msgHeight=100;
    var titleHeight=20;
    bgWidth=document.body.offsetWidth;
    bgHeight=document.body.offsetHeight;
    var titleBgColor= "#99CCFF";var bgDiv=document.createElement("div");
    bgDiv.setAttribute("id","bgDiv");
    bgDiv.style.position="absolute";
    bgDiv.style.top="0";
    bgDiv.style.left="0";
    bgDiv.style.background="#777";
    bgDiv.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75)";
    bgDiv.style.opacity="0.6";
    bgDiv.style.width=bgWidth+"px";
    bgDiv.style.height=bgHeight+"px";
    bgDiv.style.zIndex="100";
    document.body.appendChild(bgDiv);var msgDiv=document.createElement("div");
    msgDiv.setAttribute("id","msgDiv");
    msgDiv.setAttribute("align","center");
    msgDiv.style.background="white";
    msgDiv.style.position="absolute";
    msgDiv.style.left="35%";
    msgDiv.style.top="40%";
    msgDiv.style.width=msgWidth+"px";
    msgDiv.style.height=msgHeight+"px";
    msgDiv.style.textAlign="center";
    msgDiv.style.zIndex="101";var title=document.createElement("div");
    title.setAttribute("id","title");
    title.setAttribute("align","right");
    title.style.background=titleBgColor;
    title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
    title.style.opacity="0.75";
    title.style.height=titleHeight;
    title.innerHTML="<span id='closeButton' style='cursor:pointer'>Close</span>";document.body.appendChild(msgDiv);
    document.getElementById("msgDiv").appendChild(title);
    var txt=document.createElement("p");
    txt.style.margin="1em 0"
    txt.setAttribute("id","msgTxt");
    txt.innerHTML=tip;
    document.getElementById("msgDiv").appendChild(txt);
    var closeAll= document.getElementById("closeButton");
    closeAll.onclick=function(){
    document.body.removeChild(bgDiv);
    document.getElementById("msgDiv").removeChild(title);
    document.body.removeChild(msgDiv);
      }
    }
    </script>
    </head>
    <body>
    <div id="bgContent">
    <input type="button" value="PopUp" onclick="divShow(document.getElementById('txtInput').value);"/>
    <input id="txtInput" type="input" />
    </div>
    </body>
    </html>
      

  7.   

    我记的csdn中也有一帖,来说明这个的,是哪个呢