Is there a way to style HTML5’s range control?

Turns out, there is in webkit: input[type=”range”]{ -webkit-appearance:none !important; } input[type=”range”]::-webkit-slider-thumb{ -webkit-appearance:none !important; } You can then add whatever attributes you need to each those selectors. Background, gradient, etc… Hope that helps!

Add slides to Bootstrap 3 carousel dynamically using jQuery

First thing, I will rely on the fact that m is an array with proper url to your images. The HTML should be like this: <div id=”carousel-example-generic” class=”carousel slide” data-ride=”carousel”> <!– Indicators –> <ol class=”carousel-indicators”></ol> <!– Wrapper for slides –> <div class=”carousel-inner”></div> <!– Controls –> <a class=”left carousel-control” href=”#carousel-example-generic” data-slide=”prev”> <span class=”glyphicon glyphicon-chevron-left”></span> </a> <a … Read more

Logarithmic slider

You can use a function like this: function logslider(position) { // position will be between 0 and 100 var minp = 0; var maxp = 100; // The result should be between 100 an 10000000 var minv = Math.log(100); var maxv = Math.log(10000000); // calculate adjustment factor var scale = (maxv-minv) / (maxp-minp); return Math.exp(minv … Read more

HTML slider with two inputs possible?

I’ve been looking for a lightweight, dependency free dual slider for some time (it seemed crazy to import jQuery just for this) and there don’t seem to be many out there. I ended up modifying @Wildhoney’s code a bit and really like it. function getVals(){ // Get slider values var parent = this.parentNode; var slides … Read more

HTML5: Slider with two inputs possible?

I’ve been looking for a lightweight, dependency free dual slider for some time (it seemed crazy to import jQuery just for this) and there don’t seem to be many out there. I ended up modifying @Wildhoney’s code a bit and really like it. function getVals(){ // Get slider values var parent = this.parentNode; var slides … Read more

Combined total for multiple jQuery-UI Sliders

Well here ya go: var sliders = $(“#sliders .slider”); sliders.each(function() { var value = parseInt($(this).text(), 10), availableTotal = 400; $(this).empty().slider({ value: 0, min: 0, max: 400, range: “max”, step: 10, slide: function(event, ui) { // Update display to current value $(this).siblings().text(ui.value); // Get current total var total = 0; sliders.not(this).each(function() { total += $(this).slider(“option”, “value”); … Read more

Shiny slider on logarithmic scale

I wasn’t sure exactly what you wanted as the output, but what I did was have the possible p-values be [0, 0.00001, 0.0001, 0.001, 0.01]. If you want something a little different, hopefully this answer is a good enough starting point. Basically, first I created an array that holds the values of the numbers (0, … Read more

When using setInterval, if I switch tabs in Chrome and go back, the slider goes crazy catching up

How to detect when a tab is focused or not in Chrome with Javascript? window.addEventListener(‘focus’, function() { document.title=”focused”; },false); window.addEventListener(‘blur’, function() { document.title=”not focused”; },false); To apply to your situation: var autopager; function startAutopager() { autopager = window.setInterval(nextImage, 8000); } function stopAutopager() { window.clearInterval(autopager); } window.addEventListener(‘focus’, startAutopager); window.addEventListener(‘blur’, stopAutopager); Note that in the latest version … Read more