Guest User

Untitled

a guest
Jun 25th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. diff --git a/apps/contacts/js/jquery.inview.js b/apps/contacts/js/jquery.inview.js
  2. index a38ab16..e71a037 100644
  3. --- a/apps/contacts/js/jquery.inview.js
  4. +++ b/apps/contacts/js/jquery.inview.js
  5. @@ -5,7 +5,7 @@
  6. */
  7. (function ($) {
  8. var inviewObjects = {}, viewportSize, viewportOffset,
  9. - d = document, w = window, documentElement = d.documentElement, expando = $.expando;
  10. + d = document, w = window, documentElement = d.documentElement, expando = $.expando, lastScrollTime;
  11.  
  12. $.event.special.inview = {
  13. add: function(data) {
  14. @@ -46,6 +46,7 @@
  15. }
  16.  
  17. function checkInView() {
  18. + if (lastScrollTime && ((lastScrollTime - Date()) < 3000)) return;
  19. var $elements = $(), elementsLength, i = 0;
  20.  
  21. $.each(inviewObjects, function(i, inviewObject) {
  22. @@ -102,6 +103,7 @@
  23. }
  24. }
  25. }
  26. + function setTime(){lastScrollTime = Date()}
  27.  
  28. $(w).bind("scroll resize", function() {
  29. viewportSize = viewportOffset = null;
  30. @@ -114,5 +116,6 @@
  31. //
  32. // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays
  33. // intervals while the user scrolls. Therefore the inview event might fire a bit late there
  34. + $(window).scroll(setTime);
  35. setInterval(checkInView, 250);
  36. })(jQuery);
  37. \ No newline at end of file
Add Comment
Please, Sign In to add comment