jparallax icon indicating copy to clipboard operation
jparallax copied to clipboard

Feature Request: Update params after initialization

Open dtex opened this issue 11 years ago • 1 comments

I would like to be able to pass in a new xorigin, yorigin, xparallax and yparallax after a parallax has been initialized.

My specific use case is to update the yorigin so I can cause some parallax layers to fly out of the viewport and other layers to fly in (it's a rotating marquee).

I'm currently using a fade to show hide layers.

dtex avatar Nov 01 '12 20:11 dtex

Never mind. Here's how it can be done:

jQuery('#myLayer').data().parallax.layer.setParallax ( xparallax || null, yparallax || null , xorigin || null, yorigin || null);

passing null leaves the value unchanged. If this is bad, please let me know, but it seems to work.

dtex avatar Nov 02 '12 15:11 dtex