Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"snow" falls to only 75% of the visible screen, not up to the bottom #30

Closed
Zurya opened this issue Dec 3, 2014 · 5 comments
Closed

Comments

@Zurya
Copy link

Zurya commented Dec 3, 2014

I have implemented your snowfall plugin in few of our pages that have scroll bar. I implemented the plugin by using snowfall.js file and one line code below:

snowFall.snow(document.body, {round : true, minSize: 4, maxSize:7, flakeCount:50});

The issue is snow falls only up to 75% of the screen(not the page). But snow starts falling up to the bottom of the page once we change browser window size and if we restore it to original size, it keeps falling to the bottom.

If the page is refreshed, snow again falls only up to 75% of the screen.

Can you please suggest me a solution?

@Silarn
Copy link
Contributor

Silarn commented Dec 4, 2014

I may have fixed this in my multi-element support branch. I think this is caused by the offset calculations in the non jQuery version. In my branch, I modified the script to mimic the jQuery version more closely by inserting the flake images inside the target element rather than in the body using offsets to 'place' it over the target element.

This means that the flake positions only need to be positioned relative to the parent - so you don't need the top and bottom offsets - and removes some errors that can happen if those offsets are instantiated wrong.

@Zurya
Copy link
Author

Zurya commented Dec 5, 2014

Is it possible for you to provide me the modified script?

I also tried the jQuery version. Snow seems to fall up to bottom of the screen but again not to the bottom of the page! With non jQuery version, snow falls up to 75% of the screen.

@Silarn
Copy link
Contributor

Silarn commented Dec 5, 2014

Silarn/JQuery-Snowfall@51adb77

It should use the height of the target element to determine collision - so make sure your body is stretched all the way down the page. Might need a clearfix.

@loktar00
Copy link
Owner

loktar00 commented Dec 5, 2014

Hopefully this is addressed with the current version, and like @Silarn pointed out, make sure the elements boundaries actually extend to where you want the snow to fall.

@loktar00 loktar00 closed this as completed Dec 8, 2014
@Zurya
Copy link
Author

Zurya commented Dec 8, 2014

Thank you @loktar00 and @Silarn for your prompt replies and suggestions.

I happened to figure out that position of the JS code matters through trial and errors. Initially, I was placing the JS code right after opening body tag. Today, I tried placing it to just before the closing body tag, snow started falling to the bottom!! :)

Thank you once again for your wonderful plugin! 👍

Cheers!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants