wduffy / jScroll

jScroll is a jQuery plugin that keeps an element in view when a user scrolls.
http://www.wduffy.co.uk/jScroll
73 stars 19 forks source link

Cancel scrolling when browser is resized to a specific dimension #10

Closed woodss closed 8 years ago

woodss commented 12 years ago

This is not so much an issue, but more of a feature request.

Is there any way for the plugin to ONLY scroll if the $(window).width() method returns a value higher than X, so that if a browser is resized to say, a mobile size (i.e. using a responsive design), the scrolling will not happen.

Example: I have a sidebar and a content area. Sidebar currently scrolls with the content. When I resize the window to be really small, I stack sidebar and content area on top of each other so now the sidebar doesn't need to scroll.

The result at the moment is that you scroll, and then jScroll scrolls again which is obviously not desirable.

Any ideas? (Thanks for creating a great little plugin).