0.7.0 • Published 9 years ago

drop-anywhere v0.7.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

drop-anywhere

Drag and drop files anywhere to upload.

Installation

$ component install component/drop-anywhere

Example

var dropAnywhere = require('drop-anywhere');

var drop = dropAnywhere(function(e){
  e.items.forEach(function(item){
    console.log(item);
  });
});

API

DropAnywhere#unbind()

Unbind event handlers.

Example CSS

The classname .show is added when a user triggers a dragstart event. By default #drop-anywhere is stretched 100% horizontally and vertically, with a semi-transparent background.

@-webkit-keyframes show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  text-align: center;
}

#drop-anywhere {
  line-height: 500px;
  text-align: center;
  color: white;
  display: none;
}

#drop-anywhere::before {
  content: 'Drop to upload!';
}

#drop-anywhere.show {
  -webkit-animation: show 300ms;
}

License

MIT

0.7.0

9 years ago

0.6.1

11 years ago

0.6.0

11 years ago

0.5.0

11 years ago

0.4.2

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago