New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'change' event is not called after dynamic loading of sliders #76

Open
brightpixelstudio opened this Issue Dec 15, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@brightpixelstudio

brightpixelstudio commented Dec 15, 2014

I have a page where I add a bunch of sliders via an Ajax call. I set the sliders settings by passing the options after they are inserted into the page. I then bind the sliders to the change event and it never gets called. Any ideas?

// add dynamic content
$("#weightsdiv").html(sliderContent);

// initialize sliders with settings
$(".sliderctl").simpleSlider({ range: '[1,100]', theme: 'volume', highlight: 'true', step: 1 });

// bind the onchange event
$(".sliderctl").on("slider:changed", function (event, data) {
        console.log("I have changed for the best!");
        var id = $(event.target).data("id");
        $("#" + id).html(data.value.toFixed(0) + "%");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment