#About
jQuery.scraggable is a plugin that lets you drag elements by means of scrolling, single and multi dimensional (depends on browser). Implementation of this plugin was inspired by working on HTML5 puzzle game you can see now. To see it in action just go to the link, wait until a puzzle is loaded (beware! puzzle can be > 3 mb) and try to scroll it (sure if your monitor is not bigger than a puzzle). Or you can go to the plugin's site to see all possibilities in action.
To let your element(s) be scraggable just:
$(expression).scraggable([options]);
-
axis
Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values:
'x', 'y', falseDefault
false -
parent
A DOM element which will receive the
mousewheelevent. Possible values:'selector', $('selector'), document.getElementById('elementId')Default:
window.document -
sensitivity
An abstract
floatvalue for scroll sensitivity to regulate dragging speed. Default:1 -
inverted
Booleanvalue to invert dragging axis. Default:false -
containment
Constrains dragging to within the bounds of the specified element or region. Possible values:
'parent', 'document', [x1, y1, x2, y2], falseDefault:
false
-
enable
Enable the scraggable.
-
disable
Disable the scraggable.
Tested in:
- Chrome 9.0
- Firefox 3.6
- Opera 11 (single-dimensional)