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

[Feature request] canvas element created by this library should also have user-defined CSS class #42

Open
js-d-coder opened this issue Oct 17, 2017 · 2 comments

Comments

@js-d-coder
Copy link

js-d-coder commented Oct 17, 2017

Firstly, thanks a lot for this library, very helpful.
This library creates canvas element for water ripple effect, right? I am creating ripple effect on body element, sometimes due to DOM manipulation inside body element, scroll bar appears and disappears on body element. If the page loads with scroll bar on body and after deleting some elements in body scroll bar disappears because of less space required by remaining element. Because of which there appears a blank space on the left where scroll bar occupied space then.
I can fix it by setting canvas: width:100% but this can be messy hack if there were more than one canvas element on my page.

This gif to explain what I meant: https://i.imgur.com/XqdLRNR.gifv Dark blue color is the color of background on body along with background image

So my request is that your library should set some custom user-defined CSS selector which can be used in this type of situation...
Thanks

@sirxemic
Copy link
Owner

I'm curious why you closed this. You raise a fair point that the canvas should also have a class name.

However, there is a better fix for your specific case: https://github.com/sirxemic/jquery.ripples#updatesize - call this function at the right moment and the canvas should re-adjust to its container. You could also use a timer which calls this function every few frames, if you don't want to bother with calling it at the right moments.

@sirxemic sirxemic reopened this Oct 20, 2017
@js-d-coder
Copy link
Author

I closed the issue then because after reading the docs I found updateSize property which solved my problem.
None the less you should set a method which would allow us to give class selector to canvas element, can be useful to somebody else...

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

2 participants