$(window).scroll(function() { var windowsHeight = $(document).height() - $(window).height(); var currentScroll = $(document).scrollTop(); //if I scroll more than 80% if( ((currentScroll *100) / windowsHeight) > 60){ $(".outer-slider").animate({right:"0"},150); } });