-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathuser_navbar.php
44 lines (35 loc) · 1.03 KB
/
user_navbar.php
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="user_navbar_style.css">
<script src="jquery-3.2.1.min.js"></script>
</head>
<body>
<div class="nav-wrapper">
<div class="topnav" id="theTopNav">
<a href="javascript:void(0);
" class="icon" onclick="openNav()" id="hamburger">
☰
</a>
<a id="user">Welcome,  Admin !</a>
<a id="logout" href="logout_action.php" style="border-top-left-radius: 3px;"
onclick="return confirm('Are you sure?')">Logout</a>
</div>
</div>
<script>
// Function below is jquery-3 function used for making the navbar sticky
$(document).ready(function() {
$(window).scroll(function () {
if ($(window).scrollTop() > 120) {
$("#theTopNav").addClass('navbar-fixed');
}
if ($(window).scrollTop() < 121)
{
$("#theTopNav").removeClass('navbar-fixed');
}
});
});
</script>
</body>
</html>