Skip to content

gabrielgilini/javascript_dragger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copyright (c) 2008 Gabriel Gilini

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

- A simple reference on the code and it's cool :)

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

 - INTRO -

This is some generic drag code, it started as something simple I needed, then turned into something I'd like to improve continuously.
Lots of this code was made with stuff that I learned at the comp.lang.javascript FAQ <http://www.jibbering.com/faq/> and from the people at the newsgroup.
Any comments and critics will be greatly appreciated.


 - INSTRUCTIONS -

Just add the drag.js script to your page and instantiate a new Drag object when the page loads.
This constructor accepts two parameters:
    - elm
        An element reference or a string with the matching ID of the element to be dragged.
    - handler (optional)
        An element reference or a string with the matching ID of the element that will be the movement handler.
        If none is passed, the function will make the first element also be the handler.


 - DEMO -

A live demonstration can be viewed at http://www.souagil.com.br/gabriel/drag/

About

A javascript generic element dragger code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published