more digging...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-18 19:40:54 +04:00
parent af8394be69
commit f677c8369f
2 changed files with 4 additions and 4 deletions

View File

@ -128,11 +128,11 @@ $(document).ready(function(){
var x = pos_x
if(scrolling){
var s = getMagazineShift()
logger.log('>>>' + s)
shiftMagazineTo(s + (x - _x))
}
_x = x
})
/*
.on('mousemove', function(evt){
//var t = evt.timeStamp || Date.now();
evt.preventDefault()
@ -142,14 +142,13 @@ $(document).ready(function(){
_x = pos_x
}
var x = pos_x
//console.log(pos_x)
if(scrolling){
var s = getMagazineShift()
logger.log('>>>' + s)
shiftMagazineTo(s + (x - _x))
}
_x = x
})
*/
.on('mouseup touchend', function(){
logger.log('[touchend]')

View File

@ -251,6 +251,7 @@ function shiftMagazineTo(offset){
// XXX this is almost the same as getElementScale...
function getElementShift(elem){
elem = $(elem)
// using transform...
if(USE_TRANSFORM){
var vendors = ['o', 'moz', 'ms', 'webkit']
var transform = elem.css('transform')
@ -269,11 +270,11 @@ function getElementShift(elem){
if(!transform || transform == 'none'){
return {left: 0, top: 0}
}
//return parseFloat(/translate\(([-.0-9]*),/.exec(transform)[1])
return {
left: parseFloat(/(translate\(|matrix\([^,]*,[^,]*,[^,]*,[^,]*,)([^,]*),/.exec(transform)[2]),
top: null
}
// using left...
} else {
return {
left: elem.position().left,