mirror of
https://github.com/flynx/PortableMag.git
synced 2025-12-23 03:51:52 +00:00
started attempt with margin limiting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
48c5d8a250
commit
f2da6e082e
21
layout.html
21
layout.html
@ -66,6 +66,7 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
// log...
|
||||
/*
|
||||
var _log = $('<div id="log"></div>')
|
||||
.css({
|
||||
position: 'fixed',
|
||||
@ -88,6 +89,7 @@ $(document).ready(function(){
|
||||
function clear_log(){
|
||||
_log.html('')
|
||||
}
|
||||
*/
|
||||
|
||||
// keyboard...
|
||||
$(document)
|
||||
@ -114,6 +116,14 @@ $(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
|
||||
@ -136,8 +146,8 @@ $(document).ready(function(){
|
||||
window._cur_page = 0
|
||||
*/
|
||||
|
||||
$('.viewer')
|
||||
/*
|
||||
$('.viewer')
|
||||
.on('mousedown touchstart', function(){
|
||||
log('touching...')
|
||||
scroll_state = 'touching'
|
||||
@ -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),
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user