jQuery.scrollIntoView icon indicating copy to clipboard operation
jQuery.scrollIntoView copied to clipboard

Option to only scroll up and option to set an offset to the final position

Open oleics opened this issue 12 years ago • 4 comments

We need two features:

Scroll one item of a long list to the top of the browser window - and only to the top of it. I called the option .alignWithTop with respect to the native .scrollIntoView() and its alignWithTop-argument. The type of .alignWithTop is boolean.

The second feature is an option to set some offset to the position to scroll to. I called the option .offset. The type of .offset is number || integer.

This PR implements both.

oleics avatar Apr 08 '13 10:04 oleics

Great idea. .offset is useful. For .alignWithTop, it would be nice for it to fully imitate what it does in the native function; not only align to top if true, but align to bottom if false, and to force the alignment even if the element is already in view. With that in mind, something like {align:"top|bottom|auto", force:true|false} could do the trick, where {align:"auto", force:false} would be the default configuration and {align:"top", force:true} would match the native function. Thoughts?

Arwid avatar Apr 09 '13 07:04 Arwid

Is this ever being considered?

dotnetwise avatar Feb 17 '14 09:02 dotnetwise

+1

pherrymason avatar Apr 04 '14 17:04 pherrymason

+1

qstosh avatar Jun 27 '14 17:06 qstosh