jQuery(document).ready(function ($) { // Sticky navigation var yourNavigation = $(".site-header"); stickyDiv = "sticky"; yourHeader = $('.site-header').height(); $(window).scroll(function() { if( $(this).scrollTop() > yourHeader ) { yourNavigation.addClass(stickyDiv); } else { yourNavigation.removeClass(stickyDiv); } }); $(".btn-search").click(function(){ $(".searchBar").slideToggle("500", "easeInOutCirc"); $(".search-field").focus(); $(this).toggleClass('active'); }); // Homepage meet the athletes swiper var swiper = new Swiper('.meetTheAthletes', { slidesPerView: 1, spaceBetween: 10, loop: true, // init: false, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 640: { slidesPerView: 1, spaceBetween: 20, }, 768: { slidesPerView: 2, spaceBetween: 40, }, 1024: { slidesPerView: 3, spaceBetween: 50, }, } }); var swiper2 = new Swiper('.sponsors-swiper', { slidesPerView: 1, spaceBetween: 10, loop: true, autoplay: { delay: 2500, disableOnInteraction: true }, // init: false, navigation: { nextEl: '.swiper-button-right-sponsors', prevEl: '.swiper-button-left-sponsors', }, pagination: { el: '.swiper-pagination', clickable: true, }, breakpoints: { 640: { slidesPerView: 1, spaceBetween: 20, }, 768: { slidesPerView: 2, spaceBetween: 40, }, 1024: { slidesPerView: 3, spaceBetween: 50, }, } }); var titles = []; $('.topSwiper .swiper-slide').each(function(i) { titles.push($(this).data('title')); }); const topSwiper = new Swiper ('.topSwiper', { effect: 'fade', loop:true, fadeEffect: { crossFade: true }, autoplay: { delay: 5000, }, pagination: { el: '.swiper-pagination', autoplay: false, clickable: true, autoplay: { delay: 6000, }, renderBullet: function (index, className) { console.log(index); var count = index+1; var count = "0"+count+" "; return '' +' ' + count+'' + (titles[index]) + ''; }, }, }); const athleteSwiper = new Swiper ('.athleteBioSwiper', { effect: 'fade', loop:true, fadeEffect: { crossFade: true }, autoplay: { delay: 5000, }, pagination: { el: '.swiper-pagination', autoplay: true, clickable: true, autoplay: { delay: 6000, }, }, }); // Club filters var departments = []; $("select").change(function(){ $("input:checkbox").prop('checked', false); selectedPlace = $(this).children("option:selected").val(); }); $("input[name='affiliation']").change(function () { departments = $("input[type=checkbox]:checked").map(function (i) { return $(this).val(); }).get(); }); $('#change').click(function(e){ e.preventDefault(); $('.club').hide(); selectedPlace = $('select').children("option:selected").val(); if (selectedPlace == "all") { $('.club').fadeIn(); $('.no-match').hide(); } else { departments.push(selectedPlace); var displayclubs = departments.join('.'); var displayclubs = '.'+ displayclubs; $(displayclubs).fadeIn(); var numItems = $(displayclubs).length; if (numItems == 0) { var placename; $('.no-match').fadeIn(); var placename = $('select').children("option:selected").text(); $('.no-match #location').text(placename); } } }); //Todo - remove spaces from place name in class and select menu $('input[type="radio"]').click(function(){ var inputValue = $(this).attr("value"); $('.buyandsell').hide(); console.log(inputValue); if (inputValue == "both") { $('.buyandsell').fadeIn(); } else { $("." + inputValue).fadeIn(); } }); }); Textblock([ { target: "h1", minWidth: 400, maxWidth: 940, minWidth_FontSize: 24, maxWidth_FontSize: 42, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.51, units: "px", container:"self" }, { target: "h2", minWidth: 400, maxWidth: 940, minWidth_FontSize: 33, maxWidth_FontSize: 37, minWidth_LineHeight: 1.54, maxWidth_LineHeight: 1.54, units: "px" }, { target: "h3", minWidth: 400, maxWidth: 940, minWidth_FontSize: 26, maxWidth_FontSize: 29, minWidth_LineHeight: 1.1, maxWidth_LineHeight: 1.58, units: "px" }, { target: "h4", minWidth: 400, maxWidth: 940, minWidth_FontSize: 20, maxWidth_FontSize: 23, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.6, units: "px" }, { target: "h4.subtitle", minWidth: 400, maxWidth: 940, minWidth_FontSize: 16, maxWidth_FontSize: 16, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.6, units: "px" }, { target: "p, p a, .wp-block-group__inner-container ul li, .wp-block-group__inner-container ol li, .status-publish ul li, .description div, .gform_confirmation_message", minWidth: 400, maxWidth: 960, minWidth_FontSize: 16, maxWidth_FontSize: 18, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.66, units: "px", container:"self" }, { target: ".introduction p", minWidth: 400, maxWidth: 960, minWidth_FontSize: 18, maxWidth_FontSize: 22, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.66, units: "px", container:"self" }, { target: ".category, .date, .author", minWidth: 400, maxWidth: 940, minWidth_FontSize: 12, maxWidth_FontSize: 14, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.66, units: "px" } , { target: ".site-footer h4", minWidth: 400, maxWidth: 940, minWidth_FontSize: 16, maxWidth_FontSize: 18, minWidth_LineHeight: 1.5, maxWidth_LineHeight: 1.66, units: "px" } ]);