-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
68 lines (58 loc) · 2.04 KB
/
index.js
File metadata and controls
68 lines (58 loc) · 2.04 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
$(document).ready(function () {
var nav = $('.sticky-navigation'); // Change to nav div
var nav_class = 'add_shadow'; // Change to class name
$('#content').scroll(function () {
var position = $(this).scrollTop();
if (position > 0) { // If scrolled past threshold
nav.addClass(nav_class); // Add class to nav
} else { // If user scrolls back to top
if (nav.hasClass(nav_class)) { // And if class has been added
nav.removeClass(nav_class); // Remove it
}
}
});
var height = nav.height()-2;
$('.beneath').css({'margin-top': height + 'px'});
$('.fa-youtube').click(function() {
window.open("https://youtube.com/clydelawrencemusic");
});
$('.fa-facebook').click(function() {
window.open("http://facebook.com/clydelawrencemusic");
});
$('.fa-instagram').click(function() {
window.open("https://instagram.com/clydelawrencemusic");
});
$('.fa-spotify').click(function() {
window.open("http://open.spotify.com/artist/6MvAhgguWcse6KN2pwv4MP");
});
$('.fa-twitter').click(function() {
window.open("https://twitter.com/clydelmusic");
});
$('.fa-soundcloud').click(function() {
window.open("https://soundcloud.com/clydelawrencemusic");
});
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
if(isMobile.any() ) {
$('.toggle-wrapper').css("display", "block");
$('#nav-bar').css("display", "none");
}
});