$(document).ready(function(){ /*$(".gotoLink").click(function(){ var activeDiv = "."+$(this).attr("rel"); $(activeDiv).show(); $(".main-menu ul li").removeClass("active"); $(this).parent().addClass("active"); $('html, body').animate({ scrollTop: $(activeDiv).offset().top - 50 }, 2000); });*/ /*new WOW().init(); var scroll = $(window).scrollTop(); if(scroll >= 50) { $(".header").addClass("on"); }else { $(".header").removeClass("on"); } $(".credits").click(function(){ $(this).hide(); $(".credits-content").show(); }); */ $(".play-video").click(function(){ var videoURL = $(this).attr('rel'); $(".video-popup").find("iframe").attr("src",videoURL); $(".popup-overlay,.video-popup").show(); }); $(".popup .close").click(function(){ $(".popup-overlay,.popup").hide(); $(".video-popup").find("iframe").attr("src"," "); }); $("#success-stories").owlCarousel({ loop:false, margin:0, nav:true, items:1, lazyLoad:true, mouseDrag:false, touchDrag:true, onInitialized:counter, //When the plugin has initialized. onTranslated:counter //When the translation of the stage has finished. //animateOut: 'fadeOut' }); function counter(event) { var element = event.target; // DOM element, in this example .owl-carousel var items = event.item.count; // Number of items var item = event.item.index + 1; // Position of the current item // it loop is true then reset counter from 1 if(item > items) { item = item - items } $('#counter').html("0"+item+" / 0"+items) } $("#key-competencies").owlCarousel({ loop:false, margin:0, nav:true, items:1, lazyLoad:true, mouseDrag:false, touchDrag:true, onInitialized:counter1, //When the plugin has initialized. onTranslated:counter1 //When the translation of the stage has finished. //animateOut: 'fadeOut' }); function counter1(event) { var element = event.target; // DOM element, in this example .owl-carousel var items = event.item.count; // Number of items var item = event.item.index + 1; // Position of the current item // it loop is true then reset counter from 1 if(item > items) { item = item - items } $('#counter1').html("0"+item+" / 0"+items) } $("#key-verticals").owlCarousel({ loop:false, margin:0, nav:true, items:1, lazyLoad:true, mouseDrag:false, touchDrag:true, onInitialized:counter2, //When the plugin has initialized. onTranslated:counter2, //When the translation of the stage has finished. responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:3 } } //animateOut: 'fadeOut' }); function counter2(event) { var element = event.target; // DOM element, in this example .owl-carousel var items = event.item.count; // Number of items var item = event.item.index + 1; // Position of the current item // it loop is true then reset counter from 1 if(item > items) { item = item - items } $('#counter2').html("0"+item+" / 0"+items) } $(".mobile-icon a").click(function(){ $(".mobile-menu").animate({"right":"0px"}, "slow"); }); $(".close-icon a").click(function(){ $(".mobile-menu").animate({"right":"-200px"}, "slow"); }); /*$(".mobile-menu a").click(function(e){ $(".mobile-menu").animate({"right":"-200px"}, "slow"); var href = jQuery(this).attr("href"), id = href.substring(href.indexOf('#')); offsetTop = href === "#" ? 0 : jQuery(id).offset().top-topMenuHeight+1; jQuery('html, body').stop().animate({ scrollTop: offsetTop }, 300); e.preventDefault(); });*/ $(".mobile-menu").on('click', 'a[href^="#"]', function(e) { $(".mobile-menu").animate({"right":"-200px"}, "slow"); // target element id var id = $(this).attr('href'); // target element var $id = $(id); if ($id.length === 0) { return; } // prevent standard hash navigation (avoid blinking in IE) e.preventDefault(); // top position relative to the document var pos = $id.offset().top; // animated top scrolling $('body, html').animate({scrollTop: pos}); }); $("#key-verticals .item a").click(function(){ var PopupDiv = "."+$(this).attr("rel"); $(".popup-overlay,.popup+"+PopupDiv).show(); }); }); $(window).scroll(function() { /*var scroll = $(window).scrollTop(); if(scroll >= 50) { $(".header").addClass("on"); }else { $(".header").removeClass("on"); }*/ });