jquery-simple-slider icon indicating copy to clipboard operation
jquery-simple-slider copied to clipboard

Round off

Open lesleylinnett opened this issue 12 years ago • 3 comments

Simple Slider - how can I round off the output to no decimal places?

lesleylinnett avatar Feb 13 '14 17:02 lesleylinnett

you need bind the slider change function and data.value.toFixed(0)

like this:

$("[data-slider]").each(function () {
        var input = $(this);
        $("<span>")
            .addClass("output")
            .insertAfter($(this));
    }).bind("slider:ready slider:changed", function (event, data) {
        $(this)
            .nextAll(".output:first")
            .html(data.value.toFixed(0));
    });

dangercris avatar Feb 18 '14 23:02 dangercris

How and where do I add this? I have found [data-slider] in simple-slider.js but this can't be a straight swap - maybe my file is a different version - I downloaded the latest from the website. Can you please give more of idea or upload an example with this merged into the script. Many thanks for your help.

alexontheedge avatar May 12 '14 08:05 alexontheedge

Apologies, I have just seen where to add this, doh.

alexontheedge avatar May 12 '14 08:05 alexontheedge