Working slider, resets after sliding
This commit is contained in:
22
index.html
Normal file
22
index.html
Normal file
@ -0,0 +1,22 @@
|
||||
<head>
|
||||
<body>
|
||||
<form action="/button_pressed" method="get">
|
||||
<label for="brightness">Brightness:</label>
|
||||
<input type="range" id="brightness" name="brightness" min="0" max="100" onmouseup="updateBrightness(this.value)" ontouchend="updateBrightness(this.value)">
|
||||
<output id="brightness-value"></output>
|
||||
</form>
|
||||
<script>
|
||||
function updateBrightness(value) {
|
||||
document.querySelector('#brightness-value').innerHTML = value;
|
||||
window.location.href = '/button_pressed?' + value;
|
||||
}
|
||||
|
||||
function submitForm(event) {
|
||||
// Prevent the default form submission behavior
|
||||
event.preventDefault();
|
||||
// Submit the form manually
|
||||
document.querySelector('form').submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</head>
|
Reference in New Issue
Block a user