mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 11:10:08 +00:00
an experiment with transform-scrolling + scale...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
610f80315c
commit
5b2523db6d
@ -159,11 +159,8 @@ $(document).ready(function(){
|
||||
}, 500)
|
||||
})
|
||||
|
||||
|
||||
// setup the editor buttons...
|
||||
// XXX
|
||||
|
||||
|
||||
// testing scroll without zoom...
|
||||
setPageScale(1)
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -148,6 +148,8 @@ $(document).ready(function(){
|
||||
*/
|
||||
})
|
||||
|
||||
// XXX gets overwritten by iscroll...
|
||||
//setMagazineScale(1.2)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -191,6 +191,9 @@ function getMagazineTitle(){
|
||||
function getPageScale(){
|
||||
return getElementScale($('.scaler'))
|
||||
}
|
||||
function setPageScale(scale){
|
||||
return setElementScale($('.scaler'), scale)
|
||||
}
|
||||
|
||||
|
||||
// NOTE: if page is not given get the current page number...
|
||||
@ -215,8 +218,9 @@ function getPageAt(n){
|
||||
|
||||
function shiftMagazineTo(offset){
|
||||
var mag = $('.magazine')
|
||||
var scale = getMagazineScale()
|
||||
if(USE_TRANSFORM){
|
||||
var transform = 'translate('+ offset +'px, 0px) translateZ(0px)'
|
||||
var transform = 'translate('+ offset +'px, 0px) scale('+ scale +') translateZ(0px)'
|
||||
mag.css({
|
||||
'-ms-transform' : transform,
|
||||
'-webkit-transform' : transform,
|
||||
@ -228,7 +232,7 @@ function shiftMagazineTo(offset){
|
||||
left: 0,
|
||||
})
|
||||
} else {
|
||||
var transform = 'translate(0px, 0px) translateZ(0px)'
|
||||
var transform = 'translate(0px, 0px) scale('+ scale +') translateZ(0px)'
|
||||
mag.css({
|
||||
// NOTE: this will be wrong during a transition, that's why we
|
||||
// can pass the pre-calculated offset as an argument...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user