$(function() { $(window).resize(function() { goTop(); resizeleft();}); $(window).scroll(function() { goTop(); }); function resizeleft(){ var bodyW=$(window).width(); if(bodyW>1120){ $(".zx").css("right",Math.round((bodyW-1320)/2)); }else{$(".zx").hide();$(".zx").hide();} } resizeleft(); function goTop() { $(".zx").stop().animate({ "top": ($(window).height() + $(window).scrollTop() - ($(window).height() + $(".zx").height()) / 2) < 678 ? 678 :$(window).height() + $(window).scrollTop() - ($(window).height() + $(".zx").height()) / 2 }, 600); } });

$(document).ready(function(){ SexyLightbox.initialize({color:'white', dir: 'images'}); });