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,12 +159,9 @@ $(document).ready(function(){
|
|||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// testing scroll without zoom...
|
||||||
|
setPageScale(1)
|
||||||
|
|
||||||
// setup the editor buttons...
|
|
||||||
// XXX
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -148,6 +148,8 @@ $(document).ready(function(){
|
|||||||
*/
|
*/
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// XXX gets overwritten by iscroll...
|
||||||
|
//setMagazineScale(1.2)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -191,6 +191,9 @@ function getMagazineTitle(){
|
|||||||
function getPageScale(){
|
function getPageScale(){
|
||||||
return getElementScale($('.scaler'))
|
return getElementScale($('.scaler'))
|
||||||
}
|
}
|
||||||
|
function setPageScale(scale){
|
||||||
|
return setElementScale($('.scaler'), scale)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// NOTE: if page is not given get the current page number...
|
// NOTE: if page is not given get the current page number...
|
||||||
@ -215,8 +218,9 @@ function getPageAt(n){
|
|||||||
|
|
||||||
function shiftMagazineTo(offset){
|
function shiftMagazineTo(offset){
|
||||||
var mag = $('.magazine')
|
var mag = $('.magazine')
|
||||||
|
var scale = getMagazineScale()
|
||||||
if(USE_TRANSFORM){
|
if(USE_TRANSFORM){
|
||||||
var transform = 'translate('+ offset +'px, 0px) translateZ(0px)'
|
var transform = 'translate('+ offset +'px, 0px) scale('+ scale +') translateZ(0px)'
|
||||||
mag.css({
|
mag.css({
|
||||||
'-ms-transform' : transform,
|
'-ms-transform' : transform,
|
||||||
'-webkit-transform' : transform,
|
'-webkit-transform' : transform,
|
||||||
@ -228,7 +232,7 @@ function shiftMagazineTo(offset){
|
|||||||
left: 0,
|
left: 0,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
var transform = 'translate(0px, 0px) translateZ(0px)'
|
var transform = 'translate(0px, 0px) scale('+ scale +') translateZ(0px)'
|
||||||
mag.css({
|
mag.css({
|
||||||
// NOTE: this will be wrong during a transition, that's why we
|
// NOTE: this will be wrong during a transition, that's why we
|
||||||
// can pass the pre-calculated offset as an argument...
|
// can pass the pre-calculated offset as an argument...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user