From 69a9e171bf1a946aad47ac11c75de062110d6036 Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Fri, 28 Nov 2014 17:38:17 +0100 Subject: [PATCH 1/7] Add posibility to center the background --- scripts/angular-parallax.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/angular-parallax.js b/scripts/angular-parallax.js index 6ec39e8..00a7486 100644 --- a/scripts/angular-parallax.js +++ b/scripts/angular-parallax.js @@ -34,10 +34,16 @@ angular.module('angular-parallax', [ template: '
', scope: { parallaxRatio: '@', + parallaxPosition: '@' }, link: function($scope, elem, attrs) { var setPosition = function () { var calcValY = (elem.prop('offsetTop') - $window.pageYOffset) * ($scope.parallaxRatio ? $scope.parallaxRatio : 1.1 ); + + if($scope.parallaxPosition === 'center') { + calcValY -= elem[0].offsetHeight / 2; + } + // horizontal positioning elem.css('background-position', "50% " + calcValY + "px"); }; From 509433ac9dde8b62f603c87754f62ba5abce52fd Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Fri, 28 Nov 2014 17:38:42 +0100 Subject: [PATCH 2/7] Update bower.json --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index f40b1b0..2c9cd91 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-parallax", - "version": "0.0.1", + "version": "0.0.2", "homepage": "https://github.com/brettdonohoo/angular-parallax", "authors": [ "Brett Donohoo " From ace1005b4631db11bec18dba597b0064a004f79d Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Fri, 28 Nov 2014 17:40:02 +0100 Subject: [PATCH 3/7] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 48589ed..5d59fb5 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@

Angular Parallax

Nature
-
Food
+
Food
Animals
Cats
From 123344746200f1aed1440cd941d8415b7f132283 Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Fri, 28 Nov 2014 17:48:03 +0100 Subject: [PATCH 4/7] Update angular-parallax.js --- scripts/angular-parallax.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/angular-parallax.js b/scripts/angular-parallax.js index 00a7486..c1e3d90 100644 --- a/scripts/angular-parallax.js +++ b/scripts/angular-parallax.js @@ -39,7 +39,6 @@ angular.module('angular-parallax', [ link: function($scope, elem, attrs) { var setPosition = function () { var calcValY = (elem.prop('offsetTop') - $window.pageYOffset) * ($scope.parallaxRatio ? $scope.parallaxRatio : 1.1 ); - if($scope.parallaxPosition === 'center') { calcValY -= elem[0].offsetHeight / 2; } @@ -47,6 +46,8 @@ angular.module('angular-parallax', [ // horizontal positioning elem.css('background-position', "50% " + calcValY + "px"); }; + + setPosition(); // set our initial position - fixes webkit background render bug angular.element($window).bind('load', function(e) { From 8228e4cae0c908c9fb2beb7ddb49c3eaf0915858 Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Sat, 29 Nov 2014 13:35:39 +0100 Subject: [PATCH 5/7] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5d59fb5..f0c0f54 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@

Angular Parallax

Nature
-
Food
+
Food
Animals
Cats
From 606a77c0c678009f32933ca2cd22952f15fecc63 Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Sat, 29 Nov 2014 13:36:22 +0100 Subject: [PATCH 6/7] Update angular-parallax.js --- scripts/angular-parallax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/angular-parallax.js b/scripts/angular-parallax.js index c1e3d90..e260935 100644 --- a/scripts/angular-parallax.js +++ b/scripts/angular-parallax.js @@ -34,7 +34,7 @@ angular.module('angular-parallax', [ template: '
', scope: { parallaxRatio: '@', - parallaxPosition: '@' + parallaxBackgroundPosition: '@' }, link: function($scope, elem, attrs) { var setPosition = function () { From 5e37f035103d2f483a438e6fd491f9a28b421430 Mon Sep 17 00:00:00 2001 From: Marcos Sanz Date: Thu, 4 Dec 2014 09:39:05 +0100 Subject: [PATCH 7/7] Update angular-parallax.js --- scripts/angular-parallax.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/angular-parallax.js b/scripts/angular-parallax.js index e260935..a666b04 100644 --- a/scripts/angular-parallax.js +++ b/scripts/angular-parallax.js @@ -46,8 +46,6 @@ angular.module('angular-parallax', [ // horizontal positioning elem.css('background-position', "50% " + calcValY + "px"); }; - - setPosition(); // set our initial position - fixes webkit background render bug angular.element($window).bind('load', function(e) {