Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Fixes an offset-bug on pages that use multiple parallax images #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

fjenett
Copy link

@fjenett fjenett commented Dec 8, 2014

Currently the script stores only the offset().top of the first element matched by jQuery, it should instead store top for every element.

As per API definition offset() returns the position of the FIRST element, using $this will cause to return always the same value.
The `firstTop` variable stores the top of the first element only, should instead store per element.
$e should have been $element;
removed unused firstTop variable;
renamed $e to $element
@creativelycoded
Copy link

Hi,
Thanks for this fix. It was something I was just about to try to tackle.
You wouldn't know a quick fix so the backgrounds can be positioned center center by default?
I've also been trying to figure this out.

The script seems to center horizontally and position the background vertically to the top.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants