-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
451 lines (345 loc) · 13.9 KB
/
scripts.js
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
jQuery( document ).ready(function( $ ) {
$(document).on('change', '#blog-cat-menu', function() {
var theForm = $(this);
$.ajax({
url: afp_vars.afp_ajax_url,
data: theForm.serialize() + '&action=filter_posts',
type: 'POST',
dataType: 'json',
beforeSend: function() {
$('body').addClass('ajax-sort');
},
success: function(data) {
$.get(data.url, function(got) {
//console.log(got); <--this is the full markup of the new page
$('.blog_wrap').replaceWith($(got).find('.blog_wrap'));
})
.done(function() {
$('body').removeClass('ajax-sort');
//this is optional but can make for a nice URL
//history.pushState(data, 'Filter Results', data.url);
});
},
});
return false;
});
/*
//Blog Dropdown Sort
$(document).on("change", '#blog-cat-menu', function(e) {
// Prevent default action - opening tag page
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
// Get category slug from title attirbute
var category = $(this).val();
// After user click on tag, fade out list of posts
jQuery('.my-blogs').fadeOut();
data = {
action: 'filter_posts', // function to execute
afp_nonce: afp_vars.afp_nonce, // wp_nonce
category: category, // selected cat
};
jQuery.post( afp_vars.afp_ajax_url, data, function(response) {
if( response ) {
// Display posts on page
jQuery('.my-blogs').html( response );
// Restore div visibility
jQuery('.my-blogs').fadeIn();
};
});
});
//Blog Dropdown Sort END
*/
$(window).on("load resize", function(e) {
// Select and loop the container element of the elements you want to equalise
$('.team-members').each(function() {
// Cache the highest
var highestBox = 0;
// Select and loop the elements you want to equalise
$('.member-wrapper .member-job-title', this).each(function() {
// If this box is higher than the cached highest then store it
if ($(this).height() > highestBox) {
highestBox = $(this).height();
}
});
if ($(window).width() > 768) {
// Set the height of all those children to whichever was highest
$('.member-wrapper .member-job-title', this).height(highestBox);
}
});
});
//fade site in
$('body').fadeIn(1000);
// $('#topbar').delay(1500).fadeIn(1000);
// team page menu
$('.team-menu-link').click(function() {
$('.team-menu-link').removeClass('team-menu-active');
$(this).addClass('team-menu-active');
});
$(window).load(function(){
var childHeight = $("#services").height();
$(".team-section").height(childHeight);
});
var fadeOutSpeed = 300;
var changeHeightSpeed = 500;
function scrollDown() {
$('html,body').delay(500).animate({
scrollTop: $(".team-section").offset().top -100},
'slow');
}
$('.services-link').click(function() {
$('.team-members').fadeOut(fadeOutSpeed);
var childHeight = $("#services").height();
$(".team-section").delay(changeHeightSpeed).animate({
height: childHeight
}, 500, function() {
$('#services').delay().fadeIn();
});
scrollDown();
});
$('.support-link').click(function() {
$('.team-members').fadeOut(fadeOutSpeed);
var childHeight = $("#support").height();
$(".team-section").delay(changeHeightSpeed).animate({
height: childHeight
}, 500, function() {
$('#support').delay().fadeIn();
});
scrollDown();
});
$('.research-link').click(function() {
$('.team-members').fadeOut(fadeOutSpeed);
var childHeight = $("#research").height();
$(".team-section").delay(changeHeightSpeed).animate({
height: childHeight
}, 500, function() {
$('#research').delay().fadeIn();
});
scrollDown();
});
$('.legal-link').click(function() {
$('.team-members').fadeOut(fadeOutSpeed);
var childHeight = $("#legal").height();
$(".team-section").delay(changeHeightSpeed).animate({
height: childHeight
}, 500, function() {
$('#legal').delay().fadeIn();
});
scrollDown();
});
$(window).on("resize", function(e) {
$('.team-members').hide();
var childHeight = $("#services").height();
$(".team-section").height(childHeight);
$('.team-menu-link').removeClass('team-menu-active');
$('.services-link').addClass('team-menu-active');
$('#services').show();
});
// team page bio popup
// $('.window-link---').click(function() {
// $('.team-page-container').css('z-index','9999');
// $('.bio-background').fadeIn('fast', function() {
// $('html').css('overflow','hidden');
// });
// $(this).parent().next('.bio-window').delay(500).fadeIn(500);
// });
// $('.close-icon').click(function() {
// $('.bio-window').fadeOut('fast', function() {
// $('.bio-background').fadeOut(500);
//
// });
// $('html').delay(1000).css('overflow-y','scroll');
// $('.team-page-container').delay(1000).css('z-index','3');
// });
$('.window-link').click(function() {
// $('.team-page-container').css('z-index','9999');
$(' #header-outer').css('z-index','3');
$(' #topbar').css('z-index','5');
$(' #footer-outer').hide();
$('.bio-background').fadeIn(100, function() {
$('html').delay(1000).css('overflow','hidden');
});
$(this).parent().siblings('.bio-slider-fixed-wrapper').delay(500).fadeIn(500);
});
$('.close-icon').click(function() {
$('.bio-slider-fixed-wrapper').fadeOut(100, function() {
$('.bio-background').fadeOut(500);
$('html').delay(1000).css('overflow-y','scroll');
});
//$('.team-page-container').delay(1000).css('z-index','3');
$('#footer-outer').show();
});
$(window).on("load resize", function(e) {
// team hover
$('.window-link')
.mouseenter(function() {
if ($(window).width() > 768) {
$(this).children('h3').css('color', '#cc9500');
$(this).siblings('.member-job-title').css('color', '#cc9500');
$(this).children('img').css('opacity', '1');
}
})
.mouseleave(function() {
if ($(window).width() > 768) {
$(this).children('h3').css('color', '#333');
$(this).siblings('.member-job-title').css('color', '#333');
$(this).children('img').css('opacity', '.5');
}
});
if ($(window).width() < 768) {
$('.window-link').children('img').css('opacity', '1');
} else {
$('.window-link').children('img').css('opacity', '.5');
}
});
// career page position popup
$('.career-box').click(function() {
$('.careers-page-container').css('z-index','999999');
$('.bio-background').fadeIn('fast', function() {
$('html').css('overflow','hidden');
});
$(this).next().siblings('.bio-window').delay(500).fadeIn(500);
});
$('.close-icon').click(function() {
$('.bio-window').fadeOut('fast', function() {
$('.bio-background').fadeOut(500);
});
$('html').delay(1000).css('overflow-y','scroll');
$('.team-page-container').delay(1000).css('z-index','3');
});
$(" .contact-form input").focus(function() {
$(this).siblings('label').hide();
});
$(" .contact-form textarea").focus(function() {
$(this).siblings('label').hide();
});
$('#slide-out-widget-area .open-dialog a').click(function (e) {
e.preventDefault();
var goTo = this.getAttribute("href");
$('.dialog-window').fadeIn();
$('.dialog-background').fadeIn();
setTimeout(function(){
window.location = goTo;
},5000);
});
$('.close-dialog').click(function (e) {
location.reload();
});
var i=0;
$('#services .member-wrapper').each(function(){
i++;
var newID='member-'+i;
$(this).attr('id',newID);
$(this).val(i);
});
var sup=0;
$('#support .member-wrapper').each(function(){
sup++;
var newID='member-'+sup;
$(this).attr('id',newID);
$(this).val(i);
});
var res=0;
$('#research .member-wrapper').each(function(){
res++;
var newID='member-'+res;
$(this).attr('id',newID);
$(this).val(i);
});
var leg=0;
$('#legal .member-wrapper').each(function(){
leg++;
var newID='member-'+leg;
$(this).attr('id',newID);
$(this).val(i);
});
var ii=0;
$('.slider-bio-item').each(function(){
ii++;
var newID='bio-slide-'+i;
$(this).attr('id',newID);
$(this).val(i);
});
$('.bio-slider').slick({
arrows: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
slide: '.slider-bio-item',
});
$('.team-members .member-wrapper').click(function () {
var $memberID = $(this).attr("id").replace(/member-/, '');
var numReset = $memberID - 1;
$('.bio-slider').slick('slickGoTo', numReset);
});
// init controller
var controller = new ScrollMagic.Controller();
// create a scene
var scene = new ScrollMagic.Scene({
triggerElement: '#share-social', // starting scene, when reaching this element
duration: $(".content-inner").height() + 75, // pin element for the window height - 1
// duration: 70000 // pin the element for a total of 400px
})
.setPin('#share-social'); // the element we want to pin
// Add Scene to ScrollMagic Controller
controller.addScene(scene);
if ($(".page-template-template-login-news .validation_error")[0]){
// Do something if class exists
document.getElementById("defaultOpen-thank").click();
} else {
// Do something if class does not exist
}
if ($(".page-template-template-login-news .gform_confirmation_wrapper")[0]){
// Do something if class exists
$(".register-title").css("display", "none")
document.getElementById("defaultOpen-thank").click();
} else {
// Do something if class does not exist
}
if ($(".page-template-template-login-whitepapers .validation_error")[0]){
// Do something if class exists
document.getElementById("defaultOpen-thank").click();
} else {
// Do something if class does not exist
}
if ($(".page-template-template-login-whitepapers .gform_confirmation_wrapper")[0]){
// Do something if class exists
$(".register-title").css("display", "none")
document.getElementById("defaultOpen-thank").click();
} else {
// Do something if class does not exist
}
$("#loginform").submit(function(e) {
if ($('input#user_login').val() === "") {
e.preventDefault();
} else {
}
if ($('input#user_pass').val() === "") {
e.preventDefault();
} else {
}
});
$(' .main-content .open-dialog').click(function (e) {
e.preventDefault();
var goTo = this.getAttribute("href");
$('.dialog-window').fadeIn();
$('.dialog-background').fadeIn();
setTimeout(function(){
window.location = goTo;
},5000);
});
$(' #topbarinner .open-dialog').click(function (e) {
e.preventDefault();
var goTo = this.getAttribute("href");
$('.dialog-window').fadeIn();
$('.dialog-background').fadeIn();
setTimeout(function(){
window.location = goTo;
},5000);
});
$('#lostpasswordform #user_login').click(function (e) {
$('.text-inner').css('display', 'none');
});
});