一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

node.js|vue.js|jquery|angularjs|React|json|js教程|

服務(wù)器之家 - 編程語(yǔ)言 - JavaScript - js教程 - js實(shí)現(xiàn)點(diǎn)擊彈窗彈出登錄框

js實(shí)現(xiàn)點(diǎn)擊彈窗彈出登錄框

2022-03-07 15:53&小小白& js教程

這篇文章主要為大家詳細(xì)介紹了js實(shí)現(xiàn)點(diǎn)擊彈窗彈出登錄框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了js實(shí)現(xiàn)點(diǎn)擊彈窗彈出登錄框的具體代碼,供大家參考,具體內(nèi)容如下

1 圖片預(yù)覽

js實(shí)現(xiàn)點(diǎn)擊彈窗彈出登錄框

2 index.html代碼

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="zh">
 <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>js點(diǎn)擊彈窗彈出登錄框代碼</title>
 </head>
 <body>
  <style>
   *{
    margin:0;
    padding:0;
   }
         button, input{
    outline:none;
   }
   button, .login{
    width:120px;
    height:42px;
    background:#f40;
    color:#fff;
    border:none;
    border-radius:6px;
    display: block;
    margin:20px auto;
    cursor: pointer;
   }
   .popOutBg{
    width:100%;
    height:100%;
    position: fixed;
    left:0;
    top:0;
    background:rgba(0,0,0,.6);
    display: none;
   }
   .popOut{
    position:fixed;
    width:600px;
    height:300px;
    top:50%;
    left:50%;
    margin-top:-150px;
    margin-left:-300px;
    background:#fff;
    border-radius:8px;
    overflow: hidden;
    display: none;
   }
   .popOut > span{
    position: absolute;
    right:10px;
    top:0;
    height:42px;
    line-height:42px;
    color:#000;
    font-size:30px;
    cursor: pointer;
   }
   .popOut table{
    display: block;
    margin:42px auto 0;
    width:520px;
   }
   .popOut caption{
    width:520px;
    text-align: center;
    color:#f40;
    font-size:18px;
    line-height:42px;
   }
   .popOut table tr td{
    color:#666;
    padding:6px;
    font-size:14px;
   }
   .popOut table tr td:first-child{
    text-align: right;
   }
   .inp{
    width:280px;
    height:30px;
    line-height:30px;
    border:1px solid #999;
    padding:5px 10px;
    color:#000;
    font-size:14px;
    border-radius:6px;
   }
   .inp:focus{
    border-color:#f40;
   }
   @keyframes ani{
    from{
     transform:translateX(-100%) rotate(-60deg) scale(.5);
    }
    50%{
     transform:translateX(0) rotate(0) scale(1);
    }
    90%{
     transform:translateX(20px) rotate(0) scale(.8);
    }
    to{
     transform:translateX(0) rotate(0) scale(1);
    }
   }
   .ani{ animation:ani .5s ease-in-out;}
  </style>
  <button type="button">登錄</button>
  <div class="popOutBg"></div>
  <div class="popOut">
   <span title="關(guān)閉"> x </span>
   <table>
    <caption>歡迎登錄本網(wǎng)站</caption>
    <tr>
     <td width="120">用戶名:</td>
     <td><input type="text" class="inp" placeholder="請(qǐng)輸入用戶名" /></td>
    </tr>
    <tr>
     <td>密碼:</td>
     <td><input type="password" class="inp" placeholder="請(qǐng)輸入密碼" /></td>
    </tr>
    <tr>
     <td colspan="2"><input type="button" class="login" value="登錄" /></td>
    </tr>
   </table>
  </div>
  <script type="text/javascript">
   function $(param) {
    if (arguments[1] == true) {
     return document.querySelectorAll(param);
    } else {
     return document.querySelector(param);
    }
   }
   function ani() {
    $(".popOut").className = "popOut ani";
   }
   $("button").onclick = function() {
    $(".popOut").style.display = "block";
    ani();
    $(".popOutBg").style.display = "block";
   };
   $(".popOut > span").onclick = function() {
    $(".popOut").style.display = "none";
    $(".popOutBg").style.display = "none";
   };
   $(".popOutBg").onclick = function() {
    $(".popOut").style.display = "none";
    $(".popOutBg").style.display = "none";
   };
  </script>
 </body>
</html>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

原文鏈接:https://blog.csdn.net/qq_52916408/article/details/115269730

延伸 · 閱讀

精彩推薦
  • js教程不用typsescript如何使用類型增強(qiáng)功能

    不用typsescript如何使用類型增強(qiáng)功能

    這篇文章主要給大家介紹了關(guān)于不用typsescript如何使用類型增強(qiáng)功能的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參...

    小云菜7982022-02-12
  • js教程js繼承的6種方式詳解

    js繼承的6種方式詳解

    這篇文章主要給大家介紹了關(guān)于js繼承的6種方式,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面...

    Selfimpr歐10992022-02-24
  • js教程原生JavaScript實(shí)現(xiàn)輪播圖

    原生JavaScript實(shí)現(xiàn)輪播圖

    這篇文章主要為大家詳細(xì)介紹了原生JavaScript實(shí)現(xiàn)輪播圖,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下...

    棟棟很優(yōu)秀啊7042021-12-29
  • js教程JavaScript逐點(diǎn)突破系列之this是什么

    JavaScript逐點(diǎn)突破系列之this是什么

    本章將專門介紹與執(zhí)行上下文創(chuàng)建階段直接相關(guān)的最后一個(gè)細(xì)節(jié)——this是什么?以及它的指向到底是什么,感興趣的朋友跟隨小編一起看看吧...

    蛋黃酥要不要來(lái)一口阿7332022-03-03
  • js教程js實(shí)現(xiàn)拖拽拼圖游戲

    js實(shí)現(xiàn)拖拽拼圖游戲

    這篇文章主要為大家詳細(xì)介紹了js實(shí)現(xiàn)拖拽拼圖游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下...

    一個(gè)學(xué)前端的小菜鳥11662022-01-12
  • js教程JavaScript實(shí)現(xiàn)鼠標(biāo)拖拽調(diào)整div大小

    JavaScript實(shí)現(xiàn)鼠標(biāo)拖拽調(diào)整div大小

    這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)鼠標(biāo)拖拽調(diào)整div大小,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下...

    BDawn9222022-02-12
  • js教程利用前端HTML+CSS+JS開發(fā)簡(jiǎn)單的TODOLIST功能(記事本)

    利用前端HTML+CSS+JS開發(fā)簡(jiǎn)單的TODOLIST功能(記事本)

    這篇文章主要介紹了用HTML+CSS+JS做出簡(jiǎn)單的TODOLIST(記事本)項(xiàng)目,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需...

    這名沒(méi)人用吧7772022-02-28
  • js教程CocosCreator骨骼動(dòng)畫之龍骨DragonBones

    CocosCreator骨骼動(dòng)畫之龍骨DragonBones

    這篇文章主要介紹了怎么在CocosCreator中使用骨骼動(dòng)畫龍骨DragonBones,對(duì)骨骼動(dòng)畫感興趣的同學(xué),可以試一下...

    gamedaybyday3292022-03-03
主站蜘蛛池模板: 半挠脚心半黄的网站 | 国产良家 | 丰满的闺蜜2中文字幕 | 欧美a级在线观看 | 日韩二三区 | 深夜精品高中女学生 | 吃大胸寡妇的奶 | 欧产日产国产精品专区 | 高清国产激情视频在线观看 | 大桥未久midd—962在线 | 美女岳肉太深了使劲 | 999久久久免费精品国产牛牛 | x8x8在线观看免费 | 国产精品久久国产精品99盘 | 日本黄a| 免费抽搐一进一出印度 | 美女的隐私视频免费看软件 | www.日本免费 | 韩国一区二区三区 | 国产福利在线免费观看 | 动漫肉在线观看 | 99精品偷自拍 | 和两个男人玩3p好爽视频 | xxx黑人又大粗又长 xxxx性欧美极品另类 | 日本高h | 火影小南被爆羞羞网站进入 | 午夜福利院电影 | 国产91精品在线观看 | 婷射吧 | www.日日爱 | 亚洲第一免费播放区 | 无码一区二区三区视频 | 日韩资源 | 四虎影院免费在线 | 亚洲激情婷婷 | 含羞草传媒一天免费看下 | 高清免费毛片 | 动漫美女人物被黄漫在线看 | 日本又黄又裸一级大黄裸片 | 久久99精品国产免费观看 | 久久精品亚洲精品国产欧美 |