+ 3
Guys how can i change the color of box by sliding Scroll bar? [JavaScript]
actually i made this but it is not working evenly. 1)the color should increases on sliding the scroll bar and the color should be removed latterly on sliding backward How can i do this please tell me what is the problem in my Programming with giving the right why to do that. https://code.sololearn.com/Wqf9ai4lavYs/?ref=app
1 Réponse
+ 4
Put this in the script tag instead
window.setInterval(function(){
var move=document.getElementById('range').value;//get the values form slider!!!!!
var a=document.getElementById('box');
a.style.background="rgb("+(move*2.55)+",0,0)";//to change the color.
}, 100);