Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

슬라이더 step size 유동적으로

  • Loading branch information...
commit 5b135a7129bf66be1b74e4bd49946697abb42429 1 parent 1387107
Jeon Hyuncheol julyfool authored

Showing 2 changed files with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 2 static/dot.ui.js
  2. +2 2 test/slider.html
4 static/dot.ui.js
@@ -40,12 +40,12 @@ dot.UI.Slider = Backbone.View.extend({
40 40 return this;
41 41 },
42 42 minusHandler: function() {
43   - var v = Math.max(0, this.value - 10);
  43 + var v = Math.max(0, this.value - Math.floor(this.max/10));
44 44 this.goByValue(v);
45 45 this.value = v;
46 46 },
47 47 plusHandler: function() {
48   - var v = Math.min(this.value + 10, this.max);
  48 + var v = Math.min(this.value + Math.floor(this.max/10), this.max);
49 49 this.goByValue(v);
50 50 this.value = v;
51 51 },
4 test/slider.html
@@ -32,8 +32,8 @@
32 32 $(document).ready(function() {
33 33 window.s = new dot.UI.Slider({
34 34 target: $(".item-slider"),
35   - max: 50,
36   - value: 25
  35 + max: 10,
  36 + value: 5
37 37 });
38 38
39 39 s.on("change", function(val, diff) {

0 comments on commit 5b135a7

Please sign in to comment.
Something went wrong with that request. Please try again.