-
Notifications
You must be signed in to change notification settings - Fork 1
/
index2.html
50 lines (47 loc) · 1.45 KB
/
index2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./styles/main2.css" type="text/css">
<link href="">
<title>Richard's Blog</title>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
</head>
<body>
<nav>
<ul>
<li><a class="active" href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Core</a></li>
<li><a href="#">Technical</a></li>
</ul>
</nav>
<div class="grid-wrapper">
<div class="item-1">
<div class="sidebar-header">
<h1 id=>My dev Academy journey</h1>
</div>
</div>
</div>
</body>
<script>
/*$(window).on('scroll', function() {
if($(window).scrollTop()) {
$('nav').addClass('black');
} else {
$('nav').removeClass('black');
}
})*/
var stickyTop = $('.sidebar-header').offset().top;
$(window).on( 'scroll', function(){
if ($(window).scrollTop() >= stickyTop) {
$('.sidebar-header').css({position: "fixed", top: "0px"});
} else {
$('.sidebar-header').css({position: "relative", top: "0px"});
}
});
});
</script>
</html>