赋值元素不对
<div id="menu"> <ul> <li></li> </ul> </div>
像上述代码中,scrollTop应该赋值给#menu,而不是ul
document.getElementById('menu').scrollTop = localStorage.scrollTop