Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/logvinovleon/draggable_example


https://github.com/logvinovleon/draggable_example

Last synced: 17 days ago
JSON representation

Awesome Lists containing this project

README

        

You have a skeleton for a `Draggable` class. It will add a draggable behavior to a given element and to make it interesting there are some more constraints:
* Make the element draggable on both modern **desktop** and **mobile** browsers (*current version of Firefox and Chrome*)
* Add event listeners (*mouse* and *touch*) on the element to ensure that it can be dragged
* Ensure no text is selected as you drag the element
* Ensure the element always snaps to the user's mouse pointer or finger
* Apply an interesting style to the element as it's dragged
* Do **not** use function closures, global variables, or timers!
* **Bonus**: When dragging completes, make the element moves back to it's original position with a smooth, animated transition and remove the interesting style you've added wile it was draggable after the animation has completed
* **If you are getting close to the time limit** without a working result use pseudo code and comments to explain what you wanted to achieve.