Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved apple devices compatibility to use scroll function (no real tim…

…e update for now but ensures usability)

Cleaned debug code
  • Loading branch information...
commit 087e65411c0d9ad529ed6617d7266530c4688ebb 1 parent c6c0479
@jatitoam authored
View
2  package.json
@@ -4,7 +4,7 @@
"author":"Jacko Hoogeveen",
"title": "Jarallax",
"description": "The parallax scrolling opensource Javascript library",
- "version":"0.2.4",
+ "version":"0.2.4.1",
"website": "http://jarallax.com",
"destination":"bin/",
"license":
View
14 source/controllers/apple.js
@@ -9,7 +9,7 @@ ControllerApple = function(scrollPage) {
}
this.target = jQuery('body');
- this.scrollPostion = new Position(0, 0);
+ this.scrollPosition = new Position(0, 0);
};
ControllerApple.prototype = new JarallaxController();
@@ -35,8 +35,6 @@ ControllerApple.prototype.onTouch = function(event) {
var targetEvent = event.originalEvent.touches.item(0);
controller.startPosition = new Position(targetEvent.clientX, targetEvent.clientY);
-
- event.preventDefault();
};
ControllerApple.prototype.onMove = function(event) {
@@ -45,15 +43,11 @@ ControllerApple.prototype.onMove = function(event) {
var tempPosition = new Position(targetEvent.clientX, targetEvent.clientY);
var vector = tempPosition.subract(controller.startPosition);
controller.startPosition = tempPosition;
- controller.scrollPostion = vector.add(controller.scrollPostion);
+ controller.scrollPosition = vector.add(controller.scrollPosition);
- controller.scrollPostion.y = Math.max(Math.min(controller.scrollPostion.y, 0),-controller.scrollSpace);
- controller.jarallax.setProgress(-controller.scrollPostion.y / controller.scrollSpace, false);
- jQuery('body').scrollTop(controller.scrollSpace * controller.jarallax.progress);
+ controller.scrollPosition.y = Math.max(Math.min(controller.scrollPosition.y, 0),-controller.scrollSpace);
+ controller.jarallax.setProgress(-controller.scrollPosition.y / controller.scrollSpace, false);
- if (!controller.scrollPage) {
- event.preventDefault();
- }
};
ControllerApple.prototype.update = function(progress) {
View
1  source/controllers/scroll.js
@@ -40,7 +40,6 @@ ControllerScroll.prototype.deactivate = function(jarallax) {
ControllerScroll.prototype.onScroll = function(event) {
var controller = event.data.scope;
- //console.log(controller.target.scrollTop());
if(controller.jarallax.jumping){
if(!controller.jarallax.jumpingAllowed) {
View
5 source/jarallax.js
@@ -35,7 +35,8 @@ var Jarallax = function () {
if (!this.controller) {
if(jQuery.browser.iDevice) {
- this.controllers.push(new ControllerApple(false));
+ this.controllers.push(new ControllerScroll(false,
+ this.properties.horizontal, this.properties.disableVertical));
} else if (jQuery.browser.mozilla) {
this.controllers.push(new ControllerScroll(false,
this.properties.horizontal, this.properties.disableVertical));
@@ -67,8 +68,6 @@ Jarallax.prototype.setProgress = function (progress, isWeak) {
progress = 0;
}
- console.log(progress);
-
if(this.progress != progress){
this.progress = progress;
if (this.allowWeakProgress || !weak) {
Please sign in to comment.
Something went wrong with that request. Please try again.