var sticky = { sticky_after: 1, init: function() { this.header = document.getElementById("header")[0]; this.scroll(); this.events(); }, scroll: function() { if(window.scrollY > this.sticky_after) { document.body.classList.add("down"); } else { document.body.classList.remove("down"); } }, events: function() { window.addEventListener("scroll", this.scroll.bind(this)); } }; document.addEventListener("DOMContentLoaded", sticky.init.bind(sticky)); jQuery(document).ready(function($) { $('#socialiconcontainer').on('click', '.activatemenu', function(e) { e.stopPropagation(); e.preventDefault(); $('#socialiconcontainer').toggleClass('active'); $('#menu').removeClass('active'); $('#logo').removeClass('active'); }); $('#menumobilebtn').on('click', '.activatemenu', function(e) { e.stopPropagation(); e.preventDefault(); $('#menu').toggleClass('active'); $('#logo').toggleClass('active'); $('#socialiconcontainer').removeClass('active'); }); $(document).click(function(e){ if(!e.target.closest(".menurow")){ $('#menu').removeClass('active'); $('#logo').removeClass('active'); $('#socialiconcontainer').removeClass('active'); } }); var form = jQuery('.quickslide').not('#img_txt_id'); var nbroficons = form.length; var timer = 0; var counting = 0; timer = setInterval(function() { jQuery('.quickslide').attr("data-tgt" , ''); $( ".quickslide:eq(" + counting + ")" ).attr("data-tgt" , 'hello'); counting++; if (counting == nbroficons) { //alert (counting); counting = 0; } }, 250); });