$(document).ready(function(){ $("#socialIcons").html(''); function socialIconsPreload(){ if($("#accountnav").css("height")){ $("#socialIcons").css("top", "156px"); $("#socialIcons").css("right", "-170px"); $("#socialIcons").css("display", "block"); } else{ $("#socialIcons").css("top", "116px"); $("#socialIcons").css("right", "-167px"); $("#socialIcons").css("display", "block"); } $('#socialIcons').mouseover(function() { $('#socialIcons').stop(true, false).animate({right: 0}, {duration: 'slow', easing: 'easeOutExpo'}); }); $('#socialIcons').mouseleave(function() { $('#socialIcons').stop(true, false).animate({right: -127}, {duration: 'slow', easing: 'easeOutExpo'}); }); $(window).scroll(function () { if($("#accountnav").css("height")){ if($(window).scrollTop() < 156){ var socialIcons_position = 156 - $(window).scrollTop(); $("#socialIcons").css("top", socialIcons_position+'px'); } else{ $("#socialIcons").css("top", "0px"); } } else{ if($(window).scrollTop() < 116){ var socialIcons_position = 116 - $(window).scrollTop(); $("#socialIcons").css("top", socialIcons_position+'px'); } else{ $("#socialIcons").css("top", "0px"); } var socialIcons_position = 116 - $(window).scrollTop(); } }); /* (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/pl_PL/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); */ } function socialIconsFirstLoad(){ $('#socialIcons').stop(true, false).animate({right: -127}, {duration: 'slow', easing: 'easeOutExpo'}); } function socialIconsLoad(){ $('#socialIcons').stop(true, false).animate({right: 0}, {duration: 'slow', easing: 'easeOutExpo'}); setTimeout(socialIconsUnLoad,2000); } function socialIconsUnLoad(){ $('#socialIcons').stop(true, false).animate({right: -127}, {duration: 'slow', easing: 'easeOutExpo'}); } socialIconsPreload(); var loc = window.location.toString(); loc = loc.split("/"); if (loc[3] == '') { setTimeout(socialIconsLoad,1500); } else{ setTimeout(socialIconsFirstLoad,1000); } });