Ticket #3589 (closed feature)
Add scrollParent() method to detect the scrolling parent
| Reported by: | paul | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | offset | Version: | 1.2.6 |
| Keywords: | Cc: | paul, flesler | |
| Blocking: | Blocked by: |
Description
Similar to how jQuery.fn.offsetParent works, this function returns the immediate scrolling parent.
This means in detail, the first element in parents() that has one of the following css attributes set to auto or scroll: overflow, overflow-x, overflow-y.
It's especially useful in anything collision detection related - 10+ instances in jQuery UI, for example could be made a lot shorter.
Change History
comment:1 Changed 5 years ago by flesler
- Cc paul, flesler added
- need changed from Review to Test Case
comment:2 Changed 5 years ago by paul
Collision detection means:
1) Any tooltip plugin 2) Any menu plugin
In other words, any usecase where you have an element and you need to control and check in what logical container it sits in - that is always the scrollParent.
comment:3 Changed 5 years ago by flesler
tooltip and menu seem like UI to me. Any non-UI test cases.
comment:4 Changed 5 years ago by paul
There are hundreds of plugins that create similar functionality that are not part of jQuery UI - or are you talking of the generic term "user interface"?
If you're talking not specifically about jQuery UI, then your argument is almost pointless - jQuery is always used to alter/create an UI.
comment:5 Changed 3 years ago by snover
- Status changed from new to pending
This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

I'm not sure this would be useful for the common jQuery user. If it's needed in UI, maybe it'd be better to add that to UI.
Can you provide a couple of non-UI related applications ?