Skip to content

Commit

Permalink
FIX for stephband#87 (part 2): Also initialize if mouse is already ho…
Browse files Browse the repository at this point in the history
…vering over viewport.
  • Loading branch information
patricknelson committed May 10, 2016
1 parent a470d69 commit 2d194be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/jquery.parallax.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@
updateCss
);

// Also if the mouse happens to already be over the viewport, trigger an initial "mouseenter" now (since
// otherwise user would need to move mouse completely out of the viewport and then back in, in order to
// initialize the effect when it should already be started).
if (elem.is(':hover')) elem.mouseenter();

/*function freeze() {
freeze = true;
}
Expand Down

0 comments on commit 2d194be

Please sign in to comment.