-
Notifications
You must be signed in to change notification settings - Fork 0
/
popupbox.html
139 lines (115 loc) · 3.28 KB
/
popupbox.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<style>
.popup-shed {
display:none;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #393a4a;
opacity: 0.8;
transition: opacity 0.15s linear;
}
.boxpopup{
height:90%;
width:90%;
background-color:white;
margin-top: 20px;
margin-right: 20px;
margin-bottom: 20px;
margin-left: 20px;
border-radius:4px;
radius-corner:4px;
opacity: 1;
}
.popDiv{
display:none;
height:75%;
overflow-y: scroll;
}
.closeButton1{
width: 20px;
height: 25px;
padding-left: 6px;
float: right;
margin-bottom:0;
background-color:white;
border: 1px solid transparent;
font-weight: 600;
font-size:16px;
}
.closeButton2{
float: right;
margin-right: 1%;
}
.hrStyle{
margin-top:5px;
margin-bottom:5px;
}
</style>
<script>
$(document).ready(function(){
$(document).click(function(e){
var curClass=$(e.target).attr("class");
var popupDivId='#'+$(e.target).attr("popupid");
if(curClass=="popUpControl2")
{
$(popupDivId).parent().parent().css("display","block");
$(popupDivId).css("display","block");
}
else if(curClass=="popUpControl")
{
$(e.target).attr("class","popUpControl2")
$(popupDivId).wrap("<div class='popup-shed'></div>");
$(popupDivId).wrap("<div class='boxpopup'></div>");
$(popupDivId).parent()
.prepend("<button class='closeButton1'>x</button>");
$(popupDivId).parent().find(".closeButton1").
wrap("<div style='width:100%;height:20px;'></div>");
$(popupDivId).before("<hr class='hrStyle'>");
$(popupDivId).after("<div class='closeButton2 btn btn-danger'>close</div>");
$(popupDivId).after("<hr class='hrStyle'>");
$(popupDivId).parent().parent().css("display","block");
$(popupDivId).css("display","block");
}
else if(curClass=="popup-shed"||curClass=="closeButton1"||curClass=="closeButton2 btn btn-danger")
$(".popup-shed").css("display","none");
//alert(popupDivId);
});
});
</script>
</head>
<body>
<div class="popDiv" id="newPop">
<div class="container">
<h2>Vertical (basic) form</h2>
<form action="/action_page.php">
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pwd">
</div>
<div class="checkbox">
<label><input type="checkbox" name="remember"> Remember me</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
<button class="pbutton" popupid="shed1">open</button>
<button class="popUpControl" popupid="newPop">open</button>
<div id="logg">logg</div>
<script>
</script>
</body>
</html>