pixelcog / parallax.js

Simple parallax scrolling effect inspired by Spotify.com implemented as a jQuery plugin
MIT License
3.53k stars 838 forks source link

Resize trigger not functioning correct. #226

Closed Nick-lab closed 6 years ago

Nick-lab commented 6 years ago

hey :) just a small issue nothing major. I have another script to watch the "body-container" for a resize and then sends the JQuery(window).trigger('resize').trigger('scroll'); however it only works when the parallax is not in view. any ideas what might be the cause of this?

wstoettinger commented 6 years ago

I am guessing you are talking about v2? No, not yet. I'll have a look at it!

Nick-lab commented 6 years ago

okay it's nothing major so don't waist any sleep on it, just something i would like to clean up.

wstoettinger commented 6 years ago

you could also try to use $('.your-parallax-selector').parallax('refresh'); in v2 to request a refresh manually. Let me know if that works!

Nick-lab commented 6 years ago

no that didn't work unfortunately

wstoettinger commented 6 years ago

could you provide a link for testing?

Nick-lab commented 6 years ago

yea here is the link the script is at the top http://smi.swdlab.com/

wstoettinger commented 6 years ago

first of all: with $('#body-container').parallax('refresh'); you are creating a new parallax element in a different mirror container. you should use $('.parallax-window').parallax('refresh');

second: debugging would be easier, if you would put all source from the html file into a js file. and if you could use the non-minified version of the parallax plugin.

my guess is, that the differing mirror container is the culprit and/or the fact, that you are creating two of them currently.

wstoettinger commented 6 years ago

any news?

andrewvincent commented 6 years ago

Question related to this topic. I am designing a site and using this parallax effect. I also have a menu toggle and I am not able to figure out how to get the parallax window to resize when the menu toggles.

I tried: $("#menu-toggle").click(function(){ $('.parallax-mirror').parallax('refresh'); });

but it doesn't work as expected, it just keeps creating new parallax-mirror div's. I then tried to change to .parallax-window as suggested above, but that didn't do anything at all.

Any suggestions?

phuquoc164 commented 6 years ago

Dans my page https://bigmat.rnd.fr/44-materiaux/blain/, resize trigger is not functioning correct. I tried to use $('.parallax-mirror').parallax('refresh'); but it made me to go crazy.

Any suggestions ?

wstoettinger commented 6 years ago

@phuquoc164 this page is not accessible without authorization. i'm closing this issue now since the OP's question seems to be answered. if your question is still relevant, please turn to stackoverflow for help or create a new issue in case you found a bug.

chrisames commented 5 years ago

Did this ever get resolved? I've tried everything :(