summaryrefslogtreecommitdiff
path: root/web/scripts
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-10-18 17:18:51 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-10-18 17:18:51 -0700
commit31303114ef03b13ab320ee553f11a73346be7f4a (patch)
tree8e7303796900ccc2a293cc059bf0f4e31866e702 /web/scripts
parent794de015acd0328cf71ca925c9c7be8a86079fb5 (diff)
Making slider clickable.
This change enables you to click on the slider bar to move the slider.
Diffstat (limited to 'web/scripts')
-rw-r--r--web/scripts/growth.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/scripts/growth.js b/web/scripts/growth.js
index d4cee5b..5f5b273 100644
--- a/web/scripts/growth.js
+++ b/web/scripts/growth.js
@@ -10,6 +10,16 @@ $(document).ready(function()
$("#answerField").val(value);
}
});
+ $('.sliderbar').mousedown(function(e) {
+ var left = $(this).offset().left;
+ var width = $(this).width();
+ proposed = Math.max(left, Math.min(e.pageX - 23, left + width - 46));
+ $(this).children('.slider').offset({left: proposed});
+
+ var range = width - 46;
+ var value = (proposed - left) / range;
+ $("#answerField").val(value);
+ });
$('.quad .selector').draggable({
containment:"parent",