oblador / angular-parallax

Lightweight & performant parallax scrolling for angular.js.
http://oblador.github.io/angular-parallax/
MIT License
203 stars 44 forks source link

Adding "scroll-target" option #25

Closed dlhdesign closed 8 years ago

dlhdesign commented 8 years ago

Adding a simple string attribute for targeting the scrolling element. Defaults to $document.

oblador commented 8 years ago

Doesn't this introduce a jQuery dependency?

dlhdesign commented 8 years ago

jQuery (or a "jQuery light" version, at least) is already part of Angular. There are no special requirements to use it in this fashion.

oblador commented 8 years ago

jqLite doesn't support general CSS selectors like jQuery does and you are depending on the window global $ (thinking of this line) which is not available without jQuery. In angular all dependencies should be injected and not depend on globals.

It's a good functionality you're adding, thanks :+1: – but I'm not comfortable adding a jQuery dependency. If you could refactor I'd be happy to merge.

oblador commented 8 years ago

Also please reverse bumping version numbers/js builds and squash commits, then I'm happy :smile:

dlhdesign commented 8 years ago

As always for Angular, $ is available (in it's limited fashion, granted) as a global. If the developer wants to extend the available functionality (to get complex CSS selectors, for example), they can choose to include a full version of jQuery. But there is no forced dependency on it.

I appreciate your efforts on this, but I don't have the inclination nor time to modify this library further as these changes suit the needs of my client. Best of luck and thanks again for your work.