jQuery-scroll-parallax icon indicating copy to clipboard operation
jQuery-scroll-parallax copied to clipboard

Take original background position into account.

Open lhunath opened this issue 12 years ago • 2 comments

When the background image's position isn't top-left, this plugin forces it to top-left + offset as soon as you start scrolling; which is never desired when a non-default position is set.

This plugin should figure out the position of the background before it sets it, and offset its own adjustments to the original position.

lhunath avatar May 28 '13 02:05 lhunath

Looks like the problem is when the original position is not a pixel value but something like center or 50%:

parseInt(currentPosArray[1].replace(/[^0-9\-]/g, ""));

lhunath avatar May 28 '13 02:05 lhunath

You might want to use jquery's relative css instead: http://jsfiddle.net/g7mSk/

lhunath avatar May 28 '13 02:05 lhunath