Skip to content

Commit

Permalink
fix for sliders with min>0
Browse files Browse the repository at this point in the history
  • Loading branch information
peuter committed Mar 16, 2015
1 parent e1d753c commit 4ca3660
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structure/pure/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ define( ['_common'], function( design ) {
if (!$main.data('disableSliderTransform')) {
if (!isNaN(value)) {
var handleWidth = $(handle).outerWidth();
var sliderMax = $(handle).parent().slider("option","max")+Math.abs($(handle).parent().slider("option","min"));
var percent = Math.round((100/sliderMax)*(value+Math.abs($(handle).parent().slider("option","min"))));
var sliderMax = $(handle).parent().slider("option","max")+($(handle).parent().slider("option","min")*-1);
var percent = Math.round((100/sliderMax)*(value+($(handle).parent().slider("option","min")*-1)));
var translate = Math.round(handleWidth * percent/100);
//console.log("Width: "+handleWidth+", Value: "+value+", Max/Min: "+sliderMax+", %: "+percent+" => "+percent);
$(handle).css('transform', 'translateX(-'+translate+'px)');
Expand Down

0 comments on commit 4ca3660

Please sign in to comment.