Advertisement
Guest User

Untitled

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