-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Bind to scroll events? #159
Comments
Hi @kmader , this doesn't seem like a feature that I'll add into shinyjs to have native support because it's very specialized and I don't think many will use it (I try to keep shinyjs to only have common useful functionality). That said, might be able to use the |
the scroll event didn't work because a plot had nothing to scroll, the mousewheel plugin and your tool as is, works perfectly, thanks
|
The scroll event would maybe work if you place it on an element that is tall enough to require a scroll |
True, the event that gets passed if you use a function in onevent instead of a block doesn't appear to have all the fields a jquery-mousewheel event has (like deltaX, ...) https://github.com/jquery/jquery-mousewheel. All I see are below, do I need to rework the code so it sends the mousewheel-style event?
|
I just looked at the source code (because it's been a while since I wrote this feature), it looks like I do have a whitelist of properties. I looked at all the properties that exist for the standard events. shinyjs/inst/srcjs/shinyjs-default-funcs.js Line 450 in 6718270
I have to do this because many properties are not serializable and would cause the page to break when they try to be passed to R. Sine this plugin that you're using is a plugin and is not a conventional javascript event, I didn't know about those properties and they aren't in the list of accepted properties. If there's any properties you need, you can let me know which ones you specifically need |
Perfect, thanks! I forked it, changed and tested it on my machine and it works fine. I also changed clienty to clientY, I assume that was a typo? |
…retrieve additional properties that are not whitelisted by default; fixes #159
It would be great if you could bind to scroll events with shinyjs
http://api.jquery.com/scroll/
The use case would be making scroll wheel zoom in and out on a chart / rotate through different variables to be plotted.
The text was updated successfully, but these errors were encountered: