-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex6_html.html
More file actions
245 lines (226 loc) · 10.2 KB
/
index6_html.html
File metadata and controls
245 lines (226 loc) · 10.2 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html>
<head>
<style>
.left_bar {width:200px; left:0;position:absolute; left:0; top:0; background:#fff; height:100%;}
.on{display:block;}
.off{display:none;}
.full {width:100%!important;}
.none {width:0px!important;}
.right_bar {width:200px; background:#fff; height:100%;}
.right_bar ul ul {display:none;}
.right_bar ul li.active {background:#fff;}
.show {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:0; z-index:2;}
.hide {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:50px; z-index:2;}
.toggle {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:100px; z-index:2;}
.showRightMenu {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:0; right:0; z-index:2;}
.hideRightMenu {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:50px; right:0; z-index:2;}
.toggleRightMenu {position:fixed; background:#fff; padding:10px; border:solid 1px #000; top:100px; right:0; z-index:2;}
</style>
<title>Jquery Practice</title>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
</head>
<body style="margin:0; padding:0;">
<div class="show">Show Left Menu</div>
<div class="hide">Hide Left Menu</div>
<div class="hideRightMenu">Hide Right Menu</div>
<div class="showRightMenu">Show Right Menu</div>
<div class="toggleRightMenu" onclick="toggleRightMenu()">Toggle Right Menu</div>
<div class="toggle" onClick="$('.left_bar').toggle('slow');">Toggle Left Menu</div>
<div class="left_bar">
<ul>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
</ul>
</div>
<div style="">
<div class="contentBody" style="width:85%;background-color:red; text-align:right; float:left; display:inline-block;">
<p>
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
ce the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
</p>
<script>
function changeTxt(id){
$('.pContentBox').hide();
$('#'+id+'Box').show('slow');
}
</script>
<h3 onclick="$('.p1').slideToggle('slow')">What is Lorem Ipsum?</h3>
<p class="p1" id="p1Box">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</p>
<h3 id="p2Tab" onclick="changeTxt('p2')">jQuery AJAX load() Method</h3>
<div class="pContentBox" id="p2Box" style="display:block;">"jQuery load() <div/> element. orem Ipsum has been the industry's standard dummy text ever"</div>
<h3 id="p3Tab" onclick="changeTxt('p3')"> Why do we use it?</h3>
<div class="pContentBox" id="p3Box" style="display:none;">"jQuery load() element. orem Ipsum has been the industry's standard dummy text ever"</div>
<button onclick="$('.popup').slideToggle('slow');">Pop In</button>
<div class="popup" style="background:yellow; color:#000; display:none;">
<a href="javascript:void(0);" onclick="$('.popup').slideUp('slow');">Close</a><br>
Tment. orem Ipsum has been the industry's standard dummy tex simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dumm
</div>
<div>
<form name="contactForm" id="contactForm">
<input type="text" name="name" value="" id="name" /><br>
<input type="text" name="phone" value="" id="phone" /><br>
<input type="text" name="email" value="" id="email" /><br>
<input type="text" name="subject" value="" id="subject" /><br>
<textarea id="msg"></textarea><br>
<input type="submit" name="submit" value="submit" />
</form>
</div>
</div>
<script>
function dropRightMenu(id) {
$('.right_bar ul li').removeClass('active');
$('#'+id+'Tab').addClass('active');
$('.dropMenu').hide('slow');
$('#'+id+'Box').show('slow')
}
</script>
<div class="right_bar" style="width:200px; float:right; background:yellow; display:inline-block;">
<ul>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li class="" id="dropMenu1Tab" onclick="dropRightMenu('dropMenu1')"><b>Home</b>
<ul class="dropMenu" id="dropMenu1Box">
<li>sub home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
</ul>
</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li class="" id="dropMenu2Tab" onClick="dropRightMenu('dropMenu2')"><b>Home</b>
<ul class="dropMenu" id="dropMenu2Box">
<li>sub home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
</ul>
</li>
<li class="" id="dropMenu3Tab" onclick="dropRightMenu('dropMenu3')"><b>Home</b>
<ul class="dropMenu" id="dropMenu3Box">
<li>sub home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>
</ul>
</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
<li>Home</li>
<li>Home</li><li>Home</li><li>Home</li><li>Home</li>
</ul>
</div>
</div>
<script>
/*function toggleRightMenu(){
if($('.right_bar').width()== '200'){
$('.contentBody').css('width','100%');
$('.right_bar').css('width','0px');
}
else {
$('.contentBody').css('width','85%');
$('.right_bar').css('width','200px');
}
}
function toggleRightMenu(){
if($('.right_bar').width() == '200'){
$('.contentBody').addClass('full');
$('.right_bar').addClass('none');
}else{
$('.contentBody').removeClass('full');
$('.right_bar').removeClass('none');
}
}
*/
function toggleRightMenu(){
if($('.right_bar').width()== '200'){
$('.right_bar').animate({'width':'0'});
$('.contentBody').animate({'width':'100%'});
}else {
$('.right_bar').animate({'width':'200px'});
$('.contentBody').animate({'width':'85%'});
}
}
$(document).ready(function(){
$('.show').click(function(){
$('.left_bar').animate({
'left' : '0px'
});
});
$('.hide').click(function(){
$('.left_bar').animate({
'left' : '-220px'
});
});
$('.hideRightMenu').click(function(){
$('.contentBody').css({'width' : '100%'}, 'slow');
$('.right_bar').css('width', '0px'), 'slow';
});
$('.showRightMenu').click(function(){
$('.contentBody').css('width','85%');
$('.right_bar').css({'width':'200px'})
});
});
$('#contactForm').submit(function(){
if($('#name').val()==''){
alert('Please Enter your Name');
$('#name').focus();
return false;
}
if($('#phone').val()==''){
alert('Please enter your number');
$('#phone').focus();
return false;
}
if(isNaN($('#phone').val())){
alert('Please enter numeric only');
$('#phone').focus();
return false;
}
if($('#phone').val().length != 10){
alert('Pleas enter 10 digit no only');
$('#phone').focus();
return false;
}
if($('#email').val()==''){
alert('Please enter email id');
$('#email').focus();
return false;
}
else{
var email = $('#email').val();
var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
if(!pattern.test(email)){
alert('please enter valid email id');
$('#email').focus();
return false;
}
}
})
</script>
</body>
</html>