PG

$(document).ready(function() { // animation var anim = $('.animation'); if (anim != null){ if (isInViewport(anim[0])) { anim[0].classList.add("in-viewport"); } window.addEventListener('scroll', function (event) { for (var i = 0; i < anim.length; i++) { if (isInViewport(anim[i])) { anim[i].classList.add("in-viewport"); } } }, false); } // LED section var $ledNav = $(".section_5 .nav"); var $ledImg = $(".section_5 .kv-list .kv"); $ledNav.on('click', function() { $this = $(this); var n = $this.index(); $ledNav.removeClass("hd-active"); $this.addClass("hd-active"); $ledImg.removeClass("hd-active"); $ledImg.eq(n).addClass("hd-active"); }); $ledNav.on('keypress', function(e) { if(e.which == 13) { e.preventDefault(); $(this).click(); } }); // Feature section var $featureNav = $(".section_7 .nav"); var $featureContent = $(".section_7 .cont"); $featureNav.on('click', function() { $this = $(this); var n = $this.index(); $featureNav.removeClass("hd-active"); $this.addClass("hd-active"); $featureContent.removeClass("hd-active"); $featureContent.eq(n).addClass("hd-active"); }); $featureNav.on('keypress', function(e) { if(e.which == 13) { e.preventDefault(); $(this).click(); } }); });
PG