jparallax
jparallax copied to clipboard
First implementation for DeviceMotionEvent
These changes will make your plugin work with devices that have an gyroscope. If you move the device the parallax effect will be visible.
Known bugs:
- The initial position of the layers are not calculated, so there is a white space visible on the left side.
- The demos with the buttons are not working correctly.
- The minified version is nit updated.
I try to finish the bugs in my spare time.
Greetings
This is interesting, thanks for this.
I'm not going to merge it straight away, because:
- It appears to make a choice between using motion events OR mouse events. I think both should be enabled. In fact, I can think of cases where you would want to use parallax without motion events on devices that do have them enabled, so I think motion event support should be an option. (As an aside, I'm working on touch events, and there we definitely don't want an either/or choice).
- Stylistic changes (such as changing all instances of 'jQuery' to '$') are not necessary.
I'm going to study what you've done here and try and implement device motion events as an option. Great idea.
This is ok. I know that styling was not necessary, but my IDE did it by itself, sorry for that.
I want to fix some more stuff tonight, maybe that could be interesting for you too. Eventually I will integrate the option for enabling disabling too.
Greetings