Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from xtian/px

Units required for style assignment
  • Loading branch information...
commit b669981e30a6695f16546eb9a18df570d72e6a27 2 parents c721ec2 + 7c4e3c2
@yields yields authored
Showing with 5 additions and 4 deletions.
  1. +1 −0  example/index.html
  2. +4 −4 index.js
View
1  example/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<script src='../build/build.js'></script>
<style>
#draggable {
View
8 index.js
@@ -17,7 +17,7 @@ module.exports = function(el, opts){
/**
* initialize new `Draggable`.
- *
+ *
* @param {Element} el
* @param {Object} opts
*/
@@ -39,7 +39,7 @@ emitter(Draggable.prototype);
/**
* build draggable.
- *
+ *
* @return {Draggable}
*/
@@ -91,8 +91,8 @@ Draggable.prototype.onmousemove = function(e){
}
// move draggable.
- if (this.enabled('x')) styles.left = x;
- if (this.enabled('y')) styles.top = y;
+ if (this.enabled('x')) styles.left = x + 'px';
+ if (this.enabled('y')) styles.top = y + 'px';
// all done.
this.emit('drag');
Please sign in to comment.
Something went wrong with that request. Please try again.