Created
August 15, 2015 05:30
-
-
Save PhilipBale/a5b45ddbb58cf1e31647 to your computer and use it in GitHub Desktop.
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
<script type="text/javascript"> | |
$(function() { | |
$('select').selectToUISlider({ labels: 0, labelSrc: 'text', tooltip: false, sliderOptions: { | |
animate:true, | |
stop: function(e,ui) { | |
index = $('select').val(); | |
var slideHandle = $('#handle-gradient'); | |
if (index == 0) { | |
slideHandle.css({background: "linear-gradient(to right, rgba(229,124,106,1.0), rgba(229,124,106,0))", width: "50%", left: "99%"}); | |
} else if (index == 4) { | |
slideHandle.css({background: "linear-gradient(to right, rgba(229,124,106,0), rgba(229,124,106,1.0))", width: "50%", left: "-49%"}); | |
} else { | |
slideHandle.css({background: "radial-gradient(circle, rgba(229,124,106,0.0) 0%, rgba(229,124,106,0.0) 48%, rgb(229, 124, 106) 49%, rgba(229,124,106,0.0) 100%)", width: "200%", left: "-49.5%"}); | |
} | |
} | |
}}).hide(); | |
var color = "rgb(229, 124, 106)"; //$(".question .wrap").css("border-left-color"); | |
var transparentColor = color.replace(/rgb/i, "rgba").replace(/\)/i,',0.0)'); | |
$(".progress").trigger("configure", {"fgColor": color}); | |
handle = $(".ui-slider-handle").css("background-color", color); | |
gradient = retrieveOrCreateDivWithId('handle-gradient'); | |
gradient.css({background: "radial-gradient(circle, rgba(229,124,106,0.0) 0%, rgba(229,124,106,0.0) 48%, rgb(229, 124, 106) 49%, rgba(229,124,106,0.0) 100%)"}); | |
handle = $(".ui-slider-handle").css("background-color", color).prepend(gradient); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment