-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (55 loc) · 1.71 KB
/
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
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<nav>
<div class="logo">
<img src="http://epitas.in/wp-content/uploads/2019/04/logo1.png" alt="Epitas" >
</div>
<button class="btn-toggle">
<span></span>
<span></span>
<span></span>
</button>
<ul>
<li><a class="active" href="#">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="feature.html">Feature</a></li>
<li><a href="testimonial.html">Testimonial</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<section class="home">
<img id='img' src="./image/1612772535401.png" alt="">
<div id="home" class="cont">
<p id="pa">A comprehensive solution for budding programmers to learn how to code quicky</p>
<button id="btn">BOOK NOW</button>
</div>
</section>
</body>
<script>
var pa=document.getElementById("pa");
var img=document.getElementById("img");
var btn=document.getElementById("btn");
var menuUL = document.getElementsByTagName("ul");
var heightOful = menuUL[0].scrollHeight;
var btnToggle = document.getElementsByClassName("btn-toggle");
btnToggle[0].addEventListener("click",function(){
if(menuUL[0].style.maxHeight){
menuUL[0].style.maxHeight = null;
pa.style.top="0px";
img.style.top="100px";
btn.style.top="0px"
}
else{
menuUL[0].style.maxHeight = menuUL[0].scrollHeight + "px";
pa.style.top="300px";
img.style.top="400px";
btn.style.top="300px";
}
});
</script>
</html>