Skip to content

Allow for parent element point of reference for parallax-background instead of only window. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Aug 9, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 9, 2013

No description provided.

@websirnik
Copy link

I need to enable parallax for a parent div with overflow:scroll. Is that what you've meant here? Is there a way to hack it atm?

@ghost
Copy link
Author

ghost commented May 29, 2014

Yes, that was my plan. Currently, I'm calculating directly off of the window element through Angular's $window service.

var calcValY = (elem.prop('offsetTop') - $window.pageYOffset) * ($scope.parallaxRatio ? $scope.parallaxRatio : 1.1 );

I don't see it being overly difficult to modify the directive to allow for a parent element in addition to $window, but haven't taken a stab at it yet myself.

Off the top of my head, I can't think of a way to hack it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant