Advertisement
Guest User

Untitled

a guest
May 27th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var $lC = $loadingObject.find('.loading-cube'),
  2. sT = $(window).scrollTop(),
  3. eOT = $thisOffset.top,
  4. eH = $this.height(),
  5. wH = $(window).height(),
  6. cH = 25,
  7. nCP;
  8. eVH;
  9. if(sT > eOT) {
  10. if(eOT + cH > sT + wH) {
  11. eVH = wH;
  12. }
  13. else {
  14. eVH = eOT + eH + sT;
  15. }
  16. nCP = sT + eVH / 2 - cH / 2;
  17. }
  18. else {
  19. eVH = sT + wH - eOT;
  20. nCP = eVH / 2 - cH / 2
  21. }
  22.  
  23. // Now, only change cube top when necessary
  24. if(eH > eVH) {
  25. $lC.offset({ top: nCP });
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement