HTML Javascript change image with Slider bar step

后端 未结 1 1438
臣服心动
臣服心动 2021-01-27 04:18

    

        
1条回答
  •  囚心锁ツ
    2021-01-27 04:58

    I added if(newVal >= 0 && newVal < 35) with 2 conditions to check if value is in a range and then set

    You can't use document.getElementById("img").src = newVal+ ".jpg";, in that case you will get 100 different images

    
        0
        
    
    

    0 讨论(0)
提交回复
热议问题