mirror of
https://github.com/flynx/PortableMag.git
synced 2025-11-01 04:20:20 +00:00
tweeking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
30fac1c398
commit
70636ab7d9
17
layout.html
17
layout.html
@ -115,12 +115,13 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
|
|
||||||
window.scroll_state = 'none'
|
window.scroll_state = 'none'
|
||||||
window.SCROLL_STOP_THRESHOLD = 0
|
window.SCROLL_STOP_THRESHOLD = 3
|
||||||
window.SCROLL_CHECK_INTERVAL = 50
|
window.SCROLL_CHECK_INTERVAL = 50
|
||||||
|
|
||||||
window._scroll_offset = null
|
window._scroll_offset = null
|
||||||
var v = $('.viewer')
|
var v = $('.viewer')
|
||||||
|
|
||||||
|
/*
|
||||||
setInterval(function(){
|
setInterval(function(){
|
||||||
var c = v.scrollLeft()
|
var c = v.scrollLeft()
|
||||||
if(scroll_state == 'kinetic'
|
if(scroll_state == 'kinetic'
|
||||||
@ -131,10 +132,22 @@ $(document).ready(function(){
|
|||||||
v.trigger('scrollstop')
|
v.trigger('scrollstop')
|
||||||
}
|
}
|
||||||
}, SCROLL_CHECK_INTERVAL)
|
}, SCROLL_CHECK_INTERVAL)
|
||||||
|
*/
|
||||||
|
|
||||||
window._cur_page = 0
|
window._cur_page = 0
|
||||||
|
|
||||||
$('.viewer')
|
$('.viewer')
|
||||||
|
.on('scroll', function(){
|
||||||
|
log('scroll...')
|
||||||
|
var c = v.scrollLeft()
|
||||||
|
if(scroll_state == 'kinetic'
|
||||||
|
&& ((_scroll_offset - c) <= SCROLL_STOP_THRESHOLD
|
||||||
|
|| _scroll_offset - c >= -SCROLL_STOP_THRESHOLD)){
|
||||||
|
scroll_state = 'none'
|
||||||
|
log('none...')
|
||||||
|
v.trigger('scrollstop')
|
||||||
|
}
|
||||||
|
})
|
||||||
.on('mousedown touchstart', function(){
|
.on('mousedown touchstart', function(){
|
||||||
log('touching...')
|
log('touching...')
|
||||||
scroll_state = 'touching'
|
scroll_state = 'touching'
|
||||||
@ -152,7 +165,7 @@ $(document).ready(function(){
|
|||||||
// XXX for some reason, on android, this sets the page but
|
// XXX for some reason, on android, this sets the page but
|
||||||
// does not actually scroll to it -- no animation and/or
|
// does not actually scroll to it -- no animation and/or
|
||||||
// .ScrollTo does notwork...
|
// .ScrollTo does notwork...
|
||||||
setCurrentPage()
|
//setCurrentPage()
|
||||||
})
|
})
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user