jparallax icon indicating copy to clipboard operation
jparallax copied to clipboard

unparallax() seems not to work

Open mdawart opened this issue 11 years ago • 6 comments

Hi,

I want to unparallax some layers when a user clicks a button.

I'm calling

jQuery('.parallax-layer').parallax({});

to init the parallax and

jQuery('.parallax-layer').unparallax(true);

to stopp the parallax. But it did nit stop. I already checked if the functions (jQuery.fn.unparallax = function(bool) and function unparallax(node, port, events) ) are called, but the second one throws an error:

Uncaught ReferenceError: elem is not defined jquery.parallax.js:415
unstyle jquery.parallax.js:415
(anonymous function) jquery.parallax.js:515
v.extend.each jquery.min.js:2
v.fn.v.each jquery.min.js:2
jQuery.fn.unparallax

Any idea?

mdawart avatar Jan 23 '13 12:01 mdawart

Yeah, I have got some ideas. I can't look at it right away, unfortunately. It'll have to wait a few days.

On 23 January 2013 13:58, ghmicha [email protected] wrote:

Hi,

I want to unparallax some layers when a user clicks a button.

I'm calling

jQuery('.parallax-layer').parallax({});

to init the parallax and

jQuery('.parallax-layer').unparallax(true);

to stopp the parallax. But it did nit stop. I already checked if the functions (jQuery.fn.unparallax = function(bool) and function unparallax(node, port, events) ) are called, but the second one throws an error:

Uncaught ReferenceError: elem is not defined jquery.parallax.js:415unstyle jquery.parallax.js:415(anonymous function) jquery.parallax.js:515v.extend.each jquery.min.js:2v.fn.v.each jquery.min.js:2jQuery.fn.unparallax

Any idea?

— Reply to this email directly or view it on GitHubhttps://github.com/stephband/jparallax/issues/55.

stephband avatar Jan 23 '13 14:01 stephband

Hi ,

Got the same issue, did you find a solution ?

Ron

RonDg avatar Jan 25 '13 14:01 RonDg

[removed quick fix that did not always work]

mdawart avatar Feb 05 '13 10:02 mdawart

I also found out that not all times are removed when you call unparallax(), one is left:

timer frame() 4 jquery.parallax.js:73
timer remove() 3 jquery.parallax.js:123
timer remove() 2 jquery.parallax.js:123
timer remove() 1 jquery.parallax.js:123
timer frame() 1

mdawart avatar Feb 05 '13 10:02 mdawart

Should be unfreeze or unparallax?

ryansnowden avatar Apr 05 '13 12:04 ryansnowden

This hasn't been fixed I think? The documentation says you should use jQuery('.parallax-layer').trigger('freeze'); with potentially some options, but yeah, looking at the code it seems like it's no longer the way to go. How should we proceed to unparallax layers and make them return to their initial positions?

Acccent avatar Jun 21 '14 00:06 Acccent