Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <script type="text/javascript">
  2. var canSee = true;
  3. var scale = 0.50;
  4. var h = $(window).height();
  5.  
  6.  
  7. $(window).scroll(function() {
  8.  
  9. if ($(this).scrollTop() > h * scale && canSee) {
  10. $("#logo").velocity(
  11. {
  12. backgroundPositionY: "-3402px"
  13. }, {
  14. easing: [ 54 ],
  15. duration: 1350,
  16.  
  17. });
  18.  
  19. canSee = false;
  20. } else if ($(this).scrollTop() <= h * scale && !canSee) {
  21. $("#logo").velocity(
  22. {
  23. backgroundPositionY: "0px"
  24. }, {
  25. easing: [ 54 ],
  26. duration: 1350,
  27.  
  28. });
  29.  
  30. canSee = true;
  31. }
  32. });
  33. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement