Permalink
Browse files

Improve starting position.

If mouse pointer is positioned at middle of screen, this will not make the layers jump on first position update.
  • Loading branch information...
magebarf committed May 1, 2013
1 parent 2314923 commit 075936ce7956fc30d988890f49f3ec9171741e07
Showing with 2 additions and 2 deletions.
  1. +2 −2 js/plax.js
View
@@ -88,8 +88,8 @@
'right' :'',
'bottom':''
})
- layer.originX = layer.startX = this.offsetLeft
- layer.originY = layer.startY = this.offsetTop
+ layer.originX = layer.startX = position.left
+ layer.originY = layer.startY = position.top
}
layer.startX -= layer.inversionFactor * Math.floor(layer.xRange/2)

0 comments on commit 075936c

Please sign in to comment.