daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Mar 15th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // parallax
  2. $(function(){"use strict";function b(){var b=$(this).outerHeight(),c=b/2,d=a/2,e=$(this).offset().top,f=$(window).scrollTop(),g=$(this).attr("data-parallax-speed"),h=e-a,i=e+b,j=e-a,k=c+e-(d+d/2);h<0&&(h=0,i=a);var l=(f-h)/(i-h);l*=100,l*=g,l=l.toFixed(2);var m=(f-j)/(k-j);m=m.toFixed(2),m>=1&&(m=1),$(this).css("background-position","center "+l+"%")}var a=$(window).height();$(".parallax").each(b),$(window).on("scroll",function(a){$(".parallax").each(b)})});
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top