HTML實現彈出注冊頁面,整體背景變黑功能

作者:藍顏 來源: 2011-03-27 22:17:48 閱讀 我要評論 直達商品

大家可能看到別人的網站,一點注冊按鈕,會在本頁面彈出一個框,并且原網頁整體變黑,我們只能操作當前

彈出頁面來進行注冊等,可以說,這種網頁形式是非常活潑和為大家喜歡的,其具體代碼演示如下:以下代碼來自(CSDN)

標題


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
</head>

<body>
<div class="cecmbody" id="cecmpolicy">
      <div class="leftClass">
             <p>測試</p>
       <input type="button" value="點擊這里" onclick="sAlert('<a href=http://www.java50.com/>測試效果</a>');" />
 
      </div>
      <div class="rightClass">
      </div>
</div>
        <script type="text/javascript" language="javascript">

       function sAlert(str){
       document.body.style.overflow = "hidden";
       var msgw,msgh,bordercolor;
       msgw=400;//提示窗口的寬度
       msgh=100;//提示窗口的高度
       titleheight=25 //提示窗口標題高度
       bordercolor="#336699";//提示窗口的邊框顏色
       titlecolor="#99CCFF";//提示窗口的標題顏色
  
       var sWidth,sHeight;
       sWidth=document.body.offsetWidth;
       sHeight=screen.height;
       var bgObj=document.createElement("div");
       bgObj.setAttribute('id','bgDiv');
       bgObj.style.position="absolute";
       bgObj.style.top="0";
       bgObj.style.background="#777";
       bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
       bgObj.style.opacity="0.6";
       bgObj.style.left="0";
       bgObj.style.width=sWidth + "px";
       bgObj.style.height=sHeight + "px";
       bgObj.style.zIndex = "10000";
       document.body.appendChild(bgObj);
  
       var msgObj=document.createElement("div")
       msgObj.setAttribute("id","msgDiv");
       msgObj.setAttribute("align","center");
       msgObj.style.background="white";
       msgObj.style.border="1px solid " + bordercolor;
           msgObj.style.position = "absolute";
       msgObj.style.left = "50%";
                  msgObj.style.top = "50%";
                  msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
                  msgObj.style.marginLeft = "-225px" ;
                  msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
                  msgObj.style.width = msgw + "px";
                  msgObj.style.height =msgh + "px";
                  msgObj.style.textAlign = "center";
                  msgObj.style.lineHeight ="25px";
                  msgObj.style.zIndex = "10001";
  
         var title=document.createElement("h4");
         title.setAttribute("id","msgTitle");
         title.setAttribute("align","right");
         title.style.margin="0";
         title.style.padding="3px";
         title.style.background=bordercolor;
         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.border="1px solid " + bordercolor;
         title.style.height="18px";
         title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
         title.style.color="white";
         title.style.cursor="pointer";
         title.innerHTML="關閉";
         title.onclick=function(){
              document.body.removeChild(bgObj);
                    document.getElementById("msgDiv").removeChild(title);
                    document.body.removeChild(msgObj);
                    document.body.style.overflow = "auto";
                    }
         document.body.appendChild(msgObj);
         document.getElementById("msgDiv").appendChild(title);
         var txt=document.createElement("p");
         txt.style.margin="1em 0"
         txt.setAttribute("id","msgTxt");
         txt.innerHTML=str;
               document.getElementById("msgDiv").appendChild(txt);
                }
      </script>

</body>
</html>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

文章來自:http://www.java50.com JAVA武林


  推薦閱讀

  “新舟600”首飛成功(圖片)

公開飛行中新舟600飛機 告別飛行中的運七100飛機 新舟600已獲16架訂單 新華社電 26日上午,我國民航系統唯一一架現役運七100飛機在河南洛陽機場成功完成最后一次飛行,它的職業生涯終于畫上了圓滿的句號。運七100飛機>>>詳細閱讀


本文標題:HTML實現彈出注冊頁面,整體背景變黑功能

地址:http://m.sdlzkt.com/a/guandian/yejie/20110327/5477.html

樂購科技部分新聞及文章轉載自互聯網,供讀者交流和學習,若有涉及作者版權等問題請及時與我們聯系,以便更正、刪除或按規定辦理。感謝所有提供資訊的網站,歡迎各類媒體與樂購科技進行文章共享合作。

網友點評
我的評論: 人參與評論
驗證碼: 匿名回答
網友評論(點擊查看更多條評論)
友情提示: 登錄后發表評論,可以直接從評論中的用戶名進入您的個人空間,讓更多網友認識您。
自媒體專欄

評論

熱度

主站蜘蛛池模板: 成人欧美一区二区三区在线观看| 国产成人一区二区三区视频免费| 国产成人亚综合91精品首页| 成人影院wwwwwwwwwww| 亚洲国产成人久久一区www| 香蕉成人伊视频在线观看| 免费成人一级片| 欧美成人在线观看| 国产成人精品一区二三区在线观看 | 国产成人精品久久| 久久亚洲国产成人精品性色| 老司机成人影院| 国产成人污污网站在线观看| 色综七七久久成人影| 成人免费无码大片a毛片软件| 亚洲国产成人久久精品软件| 日韩成人免费aa在线看| 亚洲欧洲精品成人久久曰影片 | 国产成人免费电影| 国产成人综合久久亚洲精品| a级成人毛片久久| 久久久久亚洲av成人网人人软件| 国产成人综合美国十次| 成人午夜福利视频镇东影视| 日韩成人精品日本亚洲| 久久天堂成人影院| 亚洲精品国产成人片| 久久国产成人精品国产成人亚洲| 国产成人精品福利网站在线 | 久久综合欧美成人| 久久亚洲精品成人综合| 免看**一片成人123| 久久亚洲色www成人欧美| 亚洲国产成人99精品激情在线| 免费一级成人毛片| 欧美成人免费tv在线播放| 日本免费成人网| 免费观看成人羞羞视频软件| a级成人毛片免费视频高清| 成人性视频在线| 中国国产成人精品久久|