Does anyone know were I can find a tutorial for how to do horizontal parallax scrolling via js form scratch (i.e. no plug-in)? Or can provide me with an example
I’ve spent tons of time Googling it, but could only find tutorials using plug-ins
The reason I want to do it from scratch is because I want a perfect understanding of how parallax truly works.
I don’t mind using the jQuery library I just don’t want to rely on a plugin for the effect.
A simple tutorial
See: http://www.egstudio.biz/easy-parallax-with-jquery/
You can apply that code to 5/6 elements (with different
scaling) and create a great, simple parralax effect based on the users mouse.Here is an example, thanks to Shmiddty: http://jsfiddle.net/4kG6s/1
By scaling I mean something like this (edited from above)
Without a library such as jQuery the parallax effect would be rather difficult to implement, you’d need to manually implement all the animation rather than using the features provided in the library.
That being said however an approximate guide is something like the below implements a very poor parallax effect where the backgrounds are moving at different speeds.
CSS:
HTML:
JS: