rdallasgray/roto — pull request #22 by akao64 (2012-11-16 20:21:43+00:00)
Title: requireScrolling - graceful degradation based on slider size

This detection effectively turns off the plugin when the slider is resized so large it no longer needs to scroll.

Use case is in responsive design. In a fluid layout, the slider may be needed when the browser has mobile dimensions, but not needed at desktop dimensions (i.e. contents are smaller than the slider). The former version of this plugin attempts to maintain behaviour at the desktop dimensions with minOffset >= maxOffset (which doesn't make any sense) and behaves erratically. I've modified the plugin to detect this condition during remeasure(), reset the slider to it's default position, and prevent any further slider behaviour until the condition changes.