-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapplication.js
More file actions
84 lines (68 loc) · 1.85 KB
/
application.js
File metadata and controls
84 lines (68 loc) · 1.85 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
//= require "jquery"
//= require "jquery.fancybox"
//= require "jquery.fancybox-media"
var menuButton = $('.menu'),
mainNav = $('.site-header .main-nav'),
body = $('body'),
scrollHeight,
tickets = $('#tickets'),
ticketsDist;
$( document ).ready(function() {
// Copy Header for scroll
$(".site-header").clone().appendTo('body').addClass("scroll-header").removeClass("site-header");
// Menu Click
$( "body" ).delegate( ".menu", "click", function(e) {
e.preventDefault();
if (body.hasClass("menu-open")){
mainNav.fadeOut();
body.removeClass("menu-open");
} else {
mainNav.fadeIn();
body.addClass("menu-open");
}
});
// Scroll Links
$('a').click(function(){
if (this.getAttribute("href").charAt(0) == "#") {
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
}
});
// Mobile Ticket Links
$(".main-nav ul li.nav-tickets a").click(function(e) {
e.preventDefault();
mainNav.fadeOut();
body.removeClass("menu-open");
});
// Scroll Fun
$(window).scroll(function () {
scrollHeight = 150;
if( $(window).scrollTop() > scrollHeight ) {
$("body").addClass("scroll");
} else {
$("body").removeClass("scroll");
}
if ($(window).width() > 768 ) {
windowScroll = $(window).scrollTop();
$('.speaker-list').css({transform: 'translateY(-' + windowScroll/5 + 'px)'})
$('#speakers .cta').css({transform: 'translateY(-' + windowScroll/15 + 'px)'})
}
});
// Lightbox
$("#video").fancybox({
margin: 0,
padding: 0,
autoSize: false,
fitToView: false,
helpers : {
media : true,
overlay : {
css : {
'background' : 'rgba(22, 12, 46, 0.8)'
}
}
}
});
}); //eo:doc ready