jparallax icon indicating copy to clipboard operation
jparallax copied to clipboard

jparallax can't handle window resizing

Open wilk-polarny opened this issue 10 years ago • 1 comments

Hi there,

I have a problem with jparallax - everything works fine until you try to resize the window or the viewport. The images won't adjust to the new screen size and will jump around once you move the mouse over the mouseport. I could not find a way to reset the offsets or to reset jparallax. I tried to call unparallax and parallax again after every successful window resize action (resizing finished), but it did not work - unparallax returns: "elem: undefined element". also calling parallax twice results in flashing images.

Is there any way to fix this?

I'm currently running the latest version together with JQuery 2.1. This problem appears in every webkit browser - I haven't tested it in IE as I am not running on Windows.

wilk-polarny avatar Feb 17 '15 23:02 wilk-polarny

Had the same problem, used the 'hacky' code below to fix it.

$('.parallax-layer')
            .css({top: 0, marginTop: 0, left: 0, marginLeft: 0})
            .parallax({mouseport: $(".parallax-port")});

Sicria avatar Mar 11 '15 00:03 Sicria