Coder Social home page Coder Social logo

trenthogan / ios-html5-drag-drop-shim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timruffles/mobile-drag-drop

0.0 2.0 1.0 396 KB

A drop-in shim to allow you to use existing html5 drag'n'drop code with mobile browsers

Home Page: http://timruffles.github.io/ios-html5-drag-drop-shim/enter-leave/

License: MIT License

JavaScript 42.62% CSS 24.09% HTML 33.30%

ios-html5-drag-drop-shim's Introduction

iOS shim for HTML 5 drag'n'drop

The HTML 5 drag'n'drop API allows you to implement drag'n'drop with the same code on most desktop browsers. Unfortunately, you'll notice iOS doesn't support it, so no iPad (or Android) action for you!

Luckily, WebKit gives us enough tools to shim seamlessly. If you drop this script in your page your existing HTML 5 drag'n'drop code should just work.

Demos

Check out the demo to see it in action. It should work on Android, but I don't have an Android phone to test. Let me know @timruffles.

Install/config

If you want enter/over/leave events, add a config object to the page before you include the shim.

<script>
var iosDragDropShim = { enableEnterLeave: true }
</script>
<script src="vendor/ios-drag-drop.js"></script>

Shim behaviour

  • all drag events, with dragenter, dragover and dragleave enabled via config flag
  • creates a partially transparent drag image based on the dragged element

Thanks

To the amazing contributors who've provided massive extensions and fixes to the original.

@rem - who created the original demo used to demo this shim's drop-in nature.

License

MIT License

ios-html5-drag-drop-shim's People

Contributors

timruffles avatar xstrom avatar trenthogan avatar jhickner avatar jondum avatar jamesplease avatar shirro avatar

Watchers

James Cloos avatar  avatar

Forkers

hapara

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.