Skip to content

lencioni/jquery.scraggable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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]);

Options

  • axis

    Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values:

      'x', 'y', false
    

    Default false

  • parent

    A DOM element which will receive the mousewheel event. Possible values:

      'selector', $('selector'), document.getElementById('elementId')
    

    Default: window.document

  • sensitivity

    An abstract float value for scroll sensitivity to regulate dragging speed. Default: 1

  • inverted

    Boolean value 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], false
    

    Default: false

Methods

  • enable

    Enable the scraggable.

  • disable

    Disable the scraggable.

Compatibilty

Tested in:

  • Chrome 9.0
  • Firefox 3.6
  • Opera 11 (single-dimensional)

About

jQuery plugin for dragging elements by scrolling (single/multi dimensional)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%