-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Range Slider JS not working for dynamic content #208
Comments
K first of all keep calm man ✌️ Of course u have to trigger a initialization for dynamically added content. So you need to watch for DOM changes and trigger the rangeslider.js initialization. $('input[type="range"]', 'addedContentParentSelector').rangeslider({...}); |
K I think you did something wrong. Good luck anyway! ✌️ |
I made it work.. All good |
@punter82 I'm having a similar issue to yours, any chance that you share how you solved your issue? |
Sure. Ours is an angular JS app. So my scenario was, we have ngDialog modal where people can slide and rate, but the ngDialog was not there initially in the DOM. So i wrote a callback to detect if ngDialog was successfully opened and then the function does something like this var $r = jQuery('input[type="range"]');
// Initialize
$r.rangeslider({
polyfill: false,
onInit: function() {
// Do some logic on the plugin init
},
onSlideEnd: function(position, value) {
// Update the rating value once the slide is done
}
}); Worked like Charm. |
Hey Everyone,
I am using the basic range slider and i have written like how it is mentioned in the docs. It works fine on a page which is rendered. Basically when i view source i see the content.
But for scenarios like modal, or angular ng-view where the content is dynamically added, the range slider is not initialized and i see the default html5 slider. No errors nothing. Infact i tried initiating after opening the modal and i see the object but the slider is not changed.
Basically all the html elements needed for range slider is not appended. Any help is highly appreciated
The text was updated successfully, but these errors were encountered: