js遮罩效果制作彈出注冊(cè)界面效果
本文實(shí)例為大家分享了js遮罩效果彈出界面的具體代碼,供大家參考,具體內(nèi)容如下
<head>
<meta charset="UTF-8">
<title>遮罩</title>
<style>
* {
margin: 0;
padding: 0;
}
#shade{
position: fixed;
width: 100%;
height: 100%;
display: none;
}
.shade-background{
width: 100%;
height: 100%;
background-color: #CCCCCC;
opacity: 0.5;
}
#register{
position: relative;
background-color: #fff;
width: 500px;
height: 300px;
top: -70%;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="shade">
<div class="shade-background"></div>
<div id="register">
用戶名<input type="" name="" id="" value="" /><br />
密 碼<input type="" name="" id="" value="" /><br />
<input type="submit" name="" id="reg" value="注冊(cè)" />
</div>
</div>
<div>
<input type="button" name="" id="btn" value="彈出遮罩" />
</div>
</body>
<script>
var shade = document.getElementById("shade");
var btn = document.getElementById("btn");
var reg = document.getElementById("reg");
btn.onclick = function(){
shade.style.display = "block"
}
reg.onclick = function(){
shade.style.display = "none"
}
</script>
效果圖:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
CodeMirror2 IE7/IE8 下面未知運(yùn)行時(shí)錯(cuò)誤的解決方法
最近用CodeMirror2作后臺(tái)的模板編輯器,在IE9、Firefox下面沒有問題。到了IE7、IE8下面,textarea里面的代碼就顯示不出來了。搜索了好多,終于找到原因2012-03-03
基于JavaScript偽隨機(jī)正態(tài)分布代碼實(shí)例
這篇文章主要介紹了基于JavaScript偽隨機(jī)正態(tài)分布代碼實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-11-11
詳解maxlength屬性在textarea里奇怪的表現(xiàn)
這篇文章主要介紹了maxlength屬性在textarea里奇怪的表現(xiàn)的相關(guān)資料,需要的朋友可以參考下2015-12-12
layui 數(shù)據(jù)表格 根據(jù)值(1=業(yè)務(wù),2=機(jī)構(gòu))顯示中文名稱示例
今天小編就為大家分享一篇layui 數(shù)據(jù)表格 根據(jù)值(1=業(yè)務(wù),2=機(jī)構(gòu))顯示中文名稱示例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-10-10
js window.print實(shí)現(xiàn)打印特定控件或內(nèi)容
window.print可以打印網(wǎng)頁,但有時(shí)候我們只希望打印特定控件或內(nèi)容,怎么辦呢?可以把要打印的內(nèi)容放在div中,然后用下面的代碼進(jìn)行打印,希望對(duì)大家有所幫助2013-09-09
js實(shí)現(xiàn)帶緩動(dòng)動(dòng)畫的導(dǎo)航欄效果
本篇文章主要分享了js實(shí)現(xiàn)帶緩動(dòng)動(dòng)畫的導(dǎo)航欄效果的示例代碼。具有一定的參考價(jià)值,下面跟著小編一起來看下吧2017-01-01
微信小程序?qū)W習(xí)之?dāng)?shù)據(jù)處理詳解
這篇文章主要給大家介紹了關(guān)于微信小程序中數(shù)據(jù)處理的相關(guān)資料,文中介紹的非常詳細(xì),對(duì)大家具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考借鑒,下面來一起看看吧。2017-07-07

