another experiment.............

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-13 01:44:34 +04:00
parent 082161ed7b
commit 6b5d02984f

View File

@ -105,6 +105,9 @@ $(document).ready(function(){
_log.html(_log.html() + '<br>' + text + '') _log.html(_log.html() + '<br>' + text + '')
_log.scrollTop(_log.prop('scrollHeight')) _log.scrollTop(_log.prop('scrollHeight'))
} }
function clear_log(){
_log.html('')
}
@ -112,20 +115,22 @@ $(document).ready(function(){
var v = $('.viewer') var v = $('.viewer')
var TIMEOUT = 200 var TIMEOUT = 200
window.touching = false window.touching = false
window.t = 0 window.scrolling = false
window.t = null
function monitor_scroll(){ setInterval(function(){log('---')}, 1000)
clearTimeout(t) setInterval(function(){clear_log()}, 100000)
t = setTimeout(function(){
//if(!window.touching){
v.trigger('scrollend')
//}
}, TIMEOUT)
}
$('.viewer') $('.viewer')
.on('scroll', function(evt){ .on('scroll', function(evt){
//monitor_scroll() if(t != null){
clearTimeout(t)
}
t = setTimeout(function(){
//if(!touching){
v.trigger('scrollend')
//}
}, TIMEOUT)
}) })
.on('touchstart mousedown', function(evt){ .on('touchstart mousedown', function(evt){
//touching = true //touching = true
@ -134,17 +139,13 @@ $(document).ready(function(){
//touching = false //touching = false
//setCurrentPage() //setCurrentPage()
}) })
.on('webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend', function(){
log('transition ended...')
//v.trigger('scrollend')
setCurrentPage()
})
.on('scrollend', function(){ .on('scrollend', function(){
log('scrolling done...') log('scrolling done...')
// 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... // does not actually scroll to it -- no animation and/or
log('>>>' + setCurrentPage()) // .ScrollTo does notwork...
setCurrentPage()
}) })