From f2da6e082ec67ac95662aa196188ef25881c4855 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Feb 2013 04:52:33 +0400 Subject: [PATCH] started attempt with margin limiting... Signed-off-by: Alex A. Naanou --- layout.html | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/layout.html b/layout.html index 351f5cb..232c5d8 100755 --- a/layout.html +++ b/layout.html @@ -66,6 +66,7 @@ $(document).ready(function(){ // log... + /* var _log = $('
') .css({ position: 'fixed', @@ -88,6 +89,7 @@ $(document).ready(function(){ function clear_log(){ _log.html('') } + */ // keyboard... $(document) @@ -114,7 +116,15 @@ $(document).ready(function(){ function(k){console.log(k)})) - /* + // XXX delta-based scrollstop does not work good on android + // both the interval and scroll event versions failed... + // XXX timeout-based scrollstop des not work correctly... + // ...for some reason the timeout function gets called like + // it's an interval... + // XXX try margin-based scrolling + // in full page view set the margin so as to only allow + // scrolling the next and previous pages (in setCurrentPage)... + /* window.scroll_state = 'none' window.SCROLL_STOP_THRESHOLD = 3 window.SCROLL_CHECK_INTERVAL = 50 @@ -136,8 +146,8 @@ $(document).ready(function(){ window._cur_page = 0 */ + /* $('.viewer') - /* .on('mousedown touchstart', function(){ log('touching...') scroll_state = 'touching' @@ -146,7 +156,7 @@ $(document).ready(function(){ log('kinetic...') scroll_state = 'kinetic' }) - */ + */ //if(NAVIGATE_RELATIVE_TO_VISIBLE){ @@ -170,6 +180,15 @@ $(document).ready(function(){ setCurrentPage(0) }) +// XXX does not seem to work... +function setCurrentMargins(){ + var n = getPageNumber() + $('.magazine').css({ + 'margin-left': -$($('.page')[n-1]).position().left, + 'margin-right': -($('.magazine').width() - $($('.page')[n+2]).position().left), + }) +} +