Skip to content
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

Add EventListener on change #1286

Open
glossyweb opened this issue Dec 21, 2024 · 0 comments
Open

Add EventListener on change #1286

glossyweb opened this issue Dec 21, 2024 · 0 comments

Comments

@glossyweb
Copy link

How to add another eventlistener when noUI slider change?
Bcz i make slider for change qr code bg transparency but not work with my code.

let apply_reload_qr_code_event_listeners = () => { document.querySelectorAll('[data-reload-qr-code]').forEach(element => { let events = ['paste', 'keyup', 'change']; events.forEach(event_type => { element.removeEventListener(event_type, reload_qr_code_event_listener); element.addEventListener(event_type, reload_qr_code_event_listener); }) }); }

and noUI slider have a selector data-reload-qr-code but nothing change.

My code of slider

`$(document).ready(function() {
var sliderBlur = document.getElementById('slider_background_color_transparency');
var blurInput = document.getElementById('background_color_transparency');
noUiSlider.create(sliderBlur, {
start: blurInput.value,
behaviour: 'snap',
step: 5,
tooltips: [
{ to: function(value) { return value + '%'; } }
],
range: {
min: 0,
max: 100
}
});

sliderBlur.noUiSlider.on('update', function( values, handle ) {
	blurInput.value = values[handle];
});	

});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant