我正在使用那个滑块,我通常会在谷歌Chrome控制台中收到此错误消息。有没有办法解决它?
这是演示:
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of null
slider.js:10
Uncaught TypeError: Cannot set property 'checked' of undefinedslider @ slider.js:10
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of null
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of nullslider @ slider.js:10
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of undefinedslider @ slider.js:10
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of nullslider @ slider.js:10
slider.js:10 Uncaught TypeError: Cannot set property 'checked' of undefined
当然最好在这里包含您的代码,而不仅仅是链接到它..但无论如何
问题就在这里setInterval(function slider(){.....})
只需使用setInterval(function(){ ...... });
您也可以看看这个 http://jsfiddle.net/uL50cqmw/以后可能需要它