Browse files

Add px to style assignments.

  • Loading branch information...
1 parent 3284e11 commit 7c4e3c23fd202594308aec5ee45f3787c1339f4e @xtian xtian committed Mar 17, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 index.js
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');

0 comments on commit 7c4e3c2

Please sign in to comment.