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