jparallax
jparallax copied to clipboard
Various changes (notably translate() )
Hi,
disclaimer: I have no idea how github works and I now next to nothing about js/jquery either (my only experience being the tweaked version of jparallax below)
I made some changes to the plugin. My goals were to 1) use translate() instead of a combination of left/top and margins, both for performance reasons and to prevent the plugin from altering the layout; 2) simplify the way it works and make it more intuitive.
In my version, when the mouse goes from one side of the parallax-viewport to the other, assuming a parallax value of 1, the layers move by 50% of their parent's width (or height). That way you can tweak the port's and the layers' parent's sizes independently to get the effect you want, and draw a perfect circle with the mouse will result in the layers drawing perfect circles as well.
To be honest this works for me so I'll just leave it how it is now because I don't have the technical knowledge to improve further on it, and I don't even know how to post the version on github other than via pastebin... But if anyone's willing to have a look at it, correct whatever might be wrong or make necessary improvements, feel free to do so :)
Here the link to the pastebin: http://pastebin.com/fDYuHBty
Cheers!