$('.list-container').click(function(){ var ch = $(this).children('div'); $(this).toggleClass('selected'); if ($(this).hasClass('selected')) { ch.each(function(){ var that = $(this); that.t({ caret:false, speed:10, }) }) } }) // $('.splash').click(function(){ $('main').removeClass('firstvisit'); // }) var currentMousePos = { x: -1, y: -1 }; $('body').mousemove(function(e) { currentMousePos.x = e.pageX; currentMousePos.y = e.pageY; var val = "circle(10% at "+currentMousePos.x+"px "+currentMousePos.y+"px)" $('#grid').css('clip-path', val); }); $('', { class: 'egg', }).appendTo('#grid'); $('', { class: 'egg', }).appendTo('body'); $('.egg').hover(function(){ hideegg() }) var dw = $(document).width(); var dh = $(document).height(); function hideegg(){ var newx = Math.floor((Math.random() * dw / 30) + 1); var newy = Math.floor((Math.random() * dh / 30) + 1); $('.egg').css({"top": newy * 30, "left": newx * 30}) } hideegg() $('main .gallery a').magnificPopup({ type: 'image', zoom: { enabled: true, duration: 200, easing: 'ease-in-out', opener: function(openerElement) { return openerElement.is('img') ? openerElement : openerElement.find('img'); } }, gallery:{ enabled:true } });