Skip to content

Commit dc73631

Browse files
author
yangjiadong
committed
'2-1input'
1 parent f5620c6 commit dc73631

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

template.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE>
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html;charset=utf8"/>
5+
<style></style>
6+
<script>
7+
window.onload=function(){
8+
9+
}
10+
</script>
11+
</head>
12+
<body></body>
13+
</html>
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE>
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html;charset=utf8"/>
5+
<style>
6+
*{
7+
margin:0;
8+
padding:0;
9+
}
10+
#outer{
11+
width:300px;
12+
margin:10px auto;
13+
}
14+
ul{
15+
list-style: none;
16+
color:aqua;
17+
border:1px solid blue;
18+
width:80px;
19+
margin-top:5px;
20+
}
21+
ul li{
22+
padding:6px;
23+
}
24+
ul li:hover{
25+
cursor: pointer;
26+
background-color:#ccc;
27+
}
28+
ul li:nth-child(3){
29+
border-top:1px solid aqua;
30+
}
31+
</style>
32+
<script>
33+
window.onload=function(){
34+
var input=document.getElementById('input');
35+
var list=document.getElementById('list');
36+
input.onclick=function(){
37+
if('none'==list.style.display){
38+
list.setAttribute('style','display:block');
39+
}else{
40+
list.setAttribute('style','display:none');
41+
}
42+
}
43+
list.children.item(2).onclick=function(){
44+
list.setAttribute('style','display:none');
45+
}
46+
}
47+
</script>
48+
</head>
49+
<body>
50+
<div id="outer">
51+
<button id="input">输入法</button>
52+
<ul id="list" style="display:none">
53+
<li>手写</li>
54+
<li>拼音</li>
55+
<li>关闭</li>
56+
</ul>
57+
</div>
58+
</body>
59+
</html>

0 commit comments

Comments
 (0)