-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflex.html
More file actions
91 lines (83 loc) · 1.54 KB
/
flex.html
File metadata and controls
91 lines (83 loc) · 1.54 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
.scrollup {
width: 100%;
height: 40px;
position: fixed;
top: 0px;
display: none;
background-color: #000;
}
ul{
width:100%;
height:60px;
margin:0;padding:0;
}
li{
width:25%;
color:white;
height:60px;
float:left;
}
.s1{
width:100%;
height:60px;
}
.a1{
width:25%;
color:black;
height:60px;
float:left;
line-height:60px;
}
.b1:hover{
height:60px;
border-bottom:1px solid red;
width:40px;
}
</style>
</head>
<body>
<div class="s1">
<div class="a1"><div class="b1">home</div></div>
<div class="a1">home1</div>
<div class="a1">home2</div>
<div class="a1">home3</div>
</div>
<h1>Top of the page</h1>
<article style="height: 1000px">
<p style="margin-bottom: 600px">Scroll down the page…</p>
<p>Then click the box.</p>
<a href="#" class="scrollup">
<ul>
<li>home</li>
<li>home1</li>
<li>home2</li>
<li>home3</li>
</ul>
</a>
</article>
<script src="jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function () {
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
});
</script>
</body>
</html>