<commit_before>![](http://vignette2.wikia.nocookie.net/uncyclopedia/images/b/b4/Count-chocula.jpeg/revision/latest?cb=20110419172355)

# DRAGELEM
A simple ES6 library that allows click/touch &amp; drag on dom elements

##TO USE

```
const myDraggableElem = Object.create(dragElem);

myDraggableElem.inint(`.my-selector`);
```

##Options

You can pass in an object with options.

```
const myDraggableElem = Object.create(dragElem);

myDraggableElem.inint(`.my-selector`, {'stay' : true, 'accelerateHardware' : true);
```


###Stay
If set to true, the element will remain in place when released. If set to false the element will return to its original position when released.

###accelerateHardware
If set to true, the `will-change: transform` css property will be applied to the element

##Does it do the mobile things?
Yes. It does the mobile things.


##Try it out

http://codepen.io/tevko/pen/VeqNYZ?editors=0010<commit_msg>Fix typo & stuff<commit_after>![](http://vignette2.wikia.nocookie.net/uncyclopedia/images/b/b4/Count-chocula.jpeg/revision/latest?cb=20110419172355)

# DRAGELEM
A simple ES6 library that allows click/touch &amp; drag on dom elements

##TO USE

```
const myDraggableElem = Object.create(dragElem);

myDraggableElem.inint(`.my-selector`);
```

##Options

You can pass in an object with options.

```
const myDraggableElem = Object.create(dragElem);

myDraggableElem.init(`.my-selector`, {stay : true, accelerateHardware : true});
```


###stay
If set to true, the element will remain in place when released. If set to false the element will return to its original position when released.

###accelerateHardware
If set to true, the `will-change: transform;` css property will be applied to the element

###callBack
You can pass a callback function to fire after the element is released.

```
myDraggableElem.init(`.my-selector`, {callBack : function() { console.log(this) });
```

##Does it do the mobile things?
Yes. It does the mobile things.


##Try it out

http://codepen.io/tevko/pen/VeqNYZ?editors=0010
{'fraction_non_alphanumeric': 0.12253937007874016, 'fraction_numerical': 0.02066929133858268, 'mean_word_length': 4.944444444444445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2415594', 'n_tokens_mistral': 711, 'n_tokens_neox': 662, 'n_words': 211}