-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
related #8
- Loading branch information
Showing
3 changed files
with
17 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
//lets populate reel numbers | ||
var min = $(".rangeslider").attr("min"); | ||
var max = $(".rangeslider").attr("max"); | ||
var min = $(".slider__range").attr("min"); | ||
var max = $(".slider__range").attr("max"); | ||
|
||
updateOutput($(".rangeslider").val()); | ||
updateOutput($(".slider__range").val()); | ||
|
||
var rfigure, h; | ||
function updateOutput(figure) { | ||
//because of the step param the slider will return values in multiple of 0.05 so we have to round it up | ||
rfigure = Math.round(figure); | ||
//displaying the static output | ||
$(".static-output").html(rfigure); | ||
$(".slider__banana").html(rfigure); | ||
|
||
//positioning .static-output and .reel | ||
//horizontal positioning first | ||
h = figure/max*($(".input-wrapper").width()-$(".reel").width()) + 'px'; | ||
h = figure/max*($(".eating__slider").width()-$(".slider__reel").width()) + 'px'; | ||
|
||
//applying the positions | ||
$(".static-output, .reel").css({left: h}); | ||
$(".slider__banana, .slider__reel").css({left: h}); | ||
} |