From abb7eb0255adcdd2b1791e114080d0e3bfcffa70 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Feb 2013 01:20:24 +0400 Subject: [PATCH] another experiment............. Signed-off-by: Alex A. Naanou --- layout.html | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/layout.html b/layout.html index 47fd8a4..2a1fcd8 100755 --- a/layout.html +++ b/layout.html @@ -114,22 +114,25 @@ $(document).ready(function(){ window.touching = false window.t = 0 - setInterval(function(){ - if(!touching && scrolling){ - v.trigger('scrollend') - } - scrolling = false - }, TIMEOUT) + function monitor_scroll(){ + clearTimeout(t) + t = setTimeout(function(){ + //if(!window.touching){ + v.trigger('scrollend') + //} + }, TIMEOUT) + } $('.viewer') .on('scroll', function(evt){ - scrolling = true + //monitor_scroll() }) .on('touchstart mousedown', function(evt){ - touching = true + //touching = true }) .on('touchend mouseup', function(evt){ - touching = false + //touching = false + setCurrentPage() }) .on('scrollend', function(){