Code Monkey home page Code Monkey logo

jquery-dropbox's Introduction

About

jquery-dropbox can be used to turn elements on your site into a dropbox for files. After dropping files into this area, a callback with the dropped files is called. Now you can start uploading these files using a simple XMLHTTPRequest.

Compatibility

Tested with

  • Firefox 3.6+
  • Chrome 7+
  • Webkit Version 4.0.3 (6531.9, r51280)

Usage

Make sure the jQuery JavaScript has been loaded.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

Now low jquery-dropbox

<script type="text/javascript" src="jquery.dropbox.js"></script>

After everything is initalized, you can start defining the dropbox. A dropbox can be a various of HTML elements. We use a div for testing.

<div id="dropbox">Drag and drop file here to upload them</div>

Lets add an event listener to the dropbox.

$('#dropbox').dropbox({
	onDrop: function(files) {
		console.debug(files);
	}
});

The jQuery dropbox accepts a config object with the following parameters:

  • onDrop(files) - Function that is called after files have been dropped into the dropbox.

Hints

You can easily apply the dropbox handler to your page's body to enable page wide drag and drop support for files.

$('body').dropbox(...);

License

Please see the LICENSE file. jquery-dropbox is supported by www.onchestra.com

jquery-dropbox's People

Contributors

marcboeker avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.