localStorage - 没有时间限制的数据存储 sessionStorage - 针对一个 session 的数据存储
<script type="text/javascript">
if (localStorage.pagecount) { 

localStorage.pagecount=Number(localStorage.pagecount) +2; }else { 

localStorage.pagecount=1; }document.write("Visits: " + 

localStorage.pagecount + " time(s).");
</script>

 鼠标滚动事件

window.onscroll = function(){     
var t = document.documentElement.scrollTop || document.body.scrollTop; 
//t的值为滚动的页面top像素        }
}