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

Implement methods to allow for emulating scrolling of mouse wheel over an element #1

Open
Chuckv opened this issue Feb 17, 2015 · 6 comments

Comments

@Chuckv
Copy link

Chuckv commented Feb 17, 2015

There are a number of jquery type controls that create a scrollbox of some sort. Great example is on this page http://rocha.la/jQuery-slimScroll. obviously normal scroll functions fail on these controls, which want to be driven by mouse scrolling, or dragging of their 'scrollbar'

emulating mouse wheel scrolling would be a good way to interact with such a control, but we don't currently have a way to do that. I suggest we consider

  1. provide a 'scroll_mouse' or 'scroll_mouse_wheel' method that would accept a delta value (signed int) and fire off the appropriate event along with the delta parameter. Note this might be best because apparently not all browsers handle this the same way (see http://www.sitepoint.com/html5-javascript-mouse-wheel/ presuming it is still correct) so this would free the user from having to know what event to fire and what direction was indicated by positive/negative delta values

bit more background on why this is needed:
In terms of the example control, normal scroll functions don't work on these controls (no surprise there) and they only seem to respond to events. onmousescroll over the window, or dragging the scrollbar. The problem is that the first is not supported (we can't send a parameter indicating the wheel delta, because fire_event does not allow that) and the second is not always viable depending on the nature of the control.

If the control has the scrollbar always visible, then you can use drag operations on that element, but if the scroll control is set to appear/dissapear based on mouseover, it's flakey as hell and not reliable. firing mouseover events does not seem reliable, and in experimenting with this I've had the control just go hidden and stay that way (ugh). and if not visible, not draggable.

@Chuckv
Copy link
Author

Chuckv commented Feb 17, 2015

placed in this project as requested

@p0deje
Copy link
Owner

p0deje commented Feb 17, 2015

Thanks!

As I said, I am not sure when I can look into this, so patches are welcome!

@techsoulman
Copy link

I have the exact same need as Chuckv, I am dealing with a page that dynamically serves content to the page when a particular div is scrolled.

Have you had any luck working on this idea? Or has anyone discovered an alternative?

I'm am new to Watir and programming in general so sorry if anything I ask is noobish. Thanks!

@p0deje
Copy link
Owner

p0deje commented Oct 5, 2016

Do you mean when you scroll to div (like typical infinite scrolling implementation) or when you scroll within div.

@techsoulman
Copy link

It is within the div, it's an inner div with a scroll bar that dynamically updates it's content as you scroll it.

@p0deje
Copy link
Owner

p0deje commented Oct 5, 2016

If you can come with a test case (e.g. HTML + JS) which can be used to specify the desired behavior, I might try to find a solution. So far it's very vague to me.

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