//onchange
#/home 切换主页
$("body").html(home)
#/artcle 切换文章页
$("body").html(artcle)
但是页面切换html代码给替换了,如何保存之前的数据和状态还有滚动的位置呢?
天蓬老师2017-04-17 15:05:41
Use localStorage to save scrollTop and data,
then fill in the data if localStorage has data
Clear localStorage when leaving the page