写JS的时候遇到的问题。Uncaught TypeError: Cannot read property 'style' of null
window.onload=function(){window.onscroll=function(){vart=document.documentElement.scr...
window.onload=function(){ window.onscroll = function(){ var t = document.documentElement.scrollTop || document.body.scrollTop; var posi_box = document.getElementById( "posi_box" ); if( t >= 900 ) { posi_box.style.position = 'fixed'; } else { posi_box.style.position = 'static'; } }}Uncaught TypeError: Cannot read property 'style' of null at window.onscroll我没看出来我写错了,求指导
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询