// call external scripts $("body").append($( '' + '' )); // INITIALISATION newMETAtitle = "Wijn proef je zo! Ontdek de lekkerste wijnen bij "; orgMETAtitle = $("title").text(); animateMETAtitle = ""; if (mobile){ $("body").prepend('
'); $(".mobile").click(function(){$(this).toggleClass("open"); $(".menuItems").slideToggle(250);}); } $(window).focus(function(){ $("title").text(orgMETAtitle); clearInterval(animateMETAtitle); }).blur(function(){ $("title").text(newMETAtitle); animateMETAtitle = setInterval(function(){ $("title").text($("title").text().substring(1) + $("title").text().charAt(0)); }, 100); }); // user-interaction $(".contact").click(function(){$("html, body").animate({"scrollTop":$(document).height()-$(window).height()}, 2000, "easeOutQuart");}); $(".bottle").click(function(e){ $(this).toggleClass("zoomed"); if ($(this).hasClass("zoomed")){ $(".wineInfo .price").after('
'); $(".magnify").css({"left":0, "top":0}).fadeIn(150); $(".magnify img").attr("src", $(this).attr("src")).width($(this).width() * 4).css({"left":-e.pageX*2.65 + $(".bottle").offset().left + $(".magnify").width(), "top":-e.pageY*3.75 + $(".bottle").offset().top + $(".magnify").height()}); } else { $(".magnify").fadeOut(150, function(){$(this).remove();}); } }).mousemove(function(e){ if ($(this).hasClass("zoomed")){ $(".magnify img").css({"left":-e.pageX*2.65 + $(".bottle").offset().left + $(".magnify").width(), "top":-e.pageY*3.75 + $(".bottle").offset().top + $(".magnify").height()}); } }).mouseout(function(){ $(this).removeClass("zoomed"); $(".magnify").fadeOut(150, function(){$(this).remove();}); });