Cannot read properties of null (reading 'offsetHeight')
时间: 2023-10-12 14:08:16 浏览: 326
offsetHeight在OnLoad中获取为0的现象
"Cannot read properties of null (reading 'offsetHeight')"是一个错误提示,表示在读取一个为null的对象的属性时出错,具体是在读取'offsetHeight'属性时发生了问题。这个错误通常发生在试图访问一个不存在或被清空的元素的属性时。根据引用中的信息,这个错误可能是因为没有找到对应的HTML标签的id导致的。在你的代码中,你可能需要检查getElementById方法的参数是否正确,确保它能找到对应的元素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Cannot read properties of null (reading ‘pickAlgorithm‘)](https://blog.csdn.net/Hagiwara_Yukiho/article/details/126038582)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [Cannot read properties of null (reading ‘ xxx ‘ )的解决](https://blog.csdn.net/weixin_48104862/article/details/126292874)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文