function tabbing() { $(".energyNav li").click(function () { var showTab = $(this).attr('tabname'); $('.energyTab li').hide(); $('.' + showTab).fadeIn(); $('.energyNav li').removeClass('active'); $(this).addClass('active'); }); } function tabbing3() { $(".energyNav1 li").click(function () { var showTab = $(this).attr('tabname'); $('.energyTab1 li').hide(); $('.' + showTab).fadeIn(); $('.energyNav1 li').removeClass('active'); $(this).addClass('active'); }); } function tabbing2() { $(".energyNav .list li").click(function () { var showTab = $(this).attr('data-value').split('/'); $('.energyNav li').removeClass('active'); $(this).addClass('active'); }); } function mapchange() { $('.mapTitleWrap li').hover(function () { var currentMap = $(this).attr('mapname'); $('.map').attr('src', 'images/' + currentMap + '.gif'); $('.mapTitleWrap li').removeClass('active'); $(this).addClass('active'); }); } function Highlighted() { $('.filterSearch input[type="text"]').focus(function () { $(this).parent('.filterSearch').addClass('reverse'); }).blur(function () { $(this).parent('.filterSearch').removeClass('reverse'); }); } function slideupEach() { $(window).scroll(function () { $(".slideanim").each(function () { var pos = $(this).offset().top; var winTop = $(window).scrollTop(); if (pos < winTop + 700) { $(this).addClass("slide"); } }); }); } function countAnimation() { $('.flip').each(function () { $(this).prop('Counter', 0).animate({Counter: $(this).text()}, { duration: 4000, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now)); } }); }); } $(document).ready(function () { var winWidth = $(window).innerWidth(); $('.navbar-toggle').addClass('collapsed'); tabbing(); tabbing2(); tabbing3(); mapchange(); Highlighted(); slideupEach(); if (winWidth > 1024) { $('.sec1').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.trans1', 1.0, {y: '0', ease: Sine.easeOut}); }, {offset: '80%'}); $('.trans2').waypoint(function () { var trans2 = new TimelineLite(); trans2.to('.trans2', 1.0, {y: '0', ease: Sine.easeOut}); }, {offset: '80%'}); $('.sec2').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.speaks', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}).to('.investors', 1.0, { opacity: '1', y: '0', ease: Sine.easeOut }, '-=0.5').to('.enterprise', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}, '-=0.5'); }, {offset: '80%'}); $('.greener').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.greener', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}, '-=0.5'); }, {offset: '80%'}); $('.global').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.global', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}, '0.5'); }, {offset: '80%'}); $('.clean').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.clean', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}, '1'); }, {offset: '80%'}); } $('.footLogo').waypoint(function () { var sect1 = new TimelineLite(); sect1.to('.footLogo', 1.0, {opacity: '1', y: '0', ease: Sine.easeOut}); }, {offset: '80%'}); $("#toggle_sitemap").click(function (e) { $('html, body').animate({scrollTop: $(this).offset().top}, 'slow'); $("#sitemap_footer").slideToggle(400, function () { if ($(this).is(':visible')) { $("#toggle_sitemap").addClass('opened'); } else { $("#toggle_sitemap").removeClass('opened'); } }); }); if (winWidth <= 992) { $('.sec1').css({marginTop: '0px'}); $(window).resize(function () { $('.top_sub_navigation .container').css({'display': 'none'}); $('.resBtnClose').css({'display': 'none'}); $('.resBtnOpen').css({'display': 'block'}); }); } $('.resBtnOpen').click(function () { $('.top_sub_navigation .container').slideDown('slow'); $(this).css({'display': 'none'}); $('.resBtnClose').css({'display': 'block'}); }); $('.resBtnClose').click(function () { $('.top_sub_navigation .container').slideUp('slow'); $(this).css({'display': 'none'}); $('.resBtnOpen').css({'display': 'block'}); }); $('.resTab li').each(function () { $(this).click(function () { if ($(this).hasClass('resp-tab-active')) { $('.resTab li').find('img').css({'background': '#a6a6a6'}); $(this).find('img').css({'background-color': '#00978c'}); } }); }); $('h2.resp-accordion').click(function () { $('html, body').animate({scrollTop: $('.resTab').offset().top}, 600); }); function scrollToElement(selector, time, verticalOffset) { time = typeof(time) != 'undefined' ? time : 500; verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : -500; element = $(selector); offset = element.offset(); offsetTop = offset.top + verticalOffset; $('html, body').animate({scrollTop: offsetTop}, time); } var accTitle = $('.contact').find('h2'); $(accTitle).each(function () { $(this).click(function () { var scrollLoc = $(this).attr('scrollTo'); scrollToElement('.' + scrollLoc, 700); }); }); });