Bug Tracker

Opened 14 years ago

Closed 12 years ago

Last modified 11 years ago

#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
Blocked by: Blocking:


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 (6)

comment:1 Changed 14 years ago by flesler

Cc: paul flesler added
need: ReviewTest Case

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 ?

comment:2 Changed 14 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 14 years ago by flesler

tooltip and menu seem like UI to me. Any non-UI test cases.

comment:4 Changed 14 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 12 years ago by snover

Status: newpending

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!

comment:6 Changed 12 years ago by trac-o-bot

Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.