Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Units required for style assignment #2

Merged
merged 2 commits into from Mar 18, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −4
Split
View
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<script src='../build/build.js'></script>
<style>
#draggable {
View
@@ -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');