Permalink
Browse files

슬라이더 step size 유동적으로

  • Loading branch information...
1 parent 1387107 commit 5b135a7129bf66be1b74e4bd49946697abb42429 @chorr chorr committed Feb 23, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 static/dot.ui.js
  2. +2 −2 test/slider.html
View
@@ -40,12 +40,12 @@ dot.UI.Slider = Backbone.View.extend({
return this;
},
minusHandler: function() {
- var v = Math.max(0, this.value - 10);
+ var v = Math.max(0, this.value - Math.floor(this.max/10));
this.goByValue(v);
this.value = v;
},
plusHandler: function() {
- var v = Math.min(this.value + 10, this.max);
+ var v = Math.min(this.value + Math.floor(this.max/10), this.max);
this.goByValue(v);
this.value = v;
},
View
@@ -32,8 +32,8 @@
$(document).ready(function() {
window.s = new dot.UI.Slider({
target: $(".item-slider"),
- max: 50,
- value: 25
+ max: 10,
+ value: 5
});
s.on("change", function(val, diff) {

0 comments on commit 5b135a7

Please sign in to comment.