Commit aedcff58 by 刘海龙

111

parent 57e0bb42
...@@ -207,7 +207,25 @@ ...@@ -207,7 +207,25 @@
mounted:function(){ mounted:function(){
$("#preloader").hide(); $("#preloader").hide();
this.onTopTab(0) this.onTopTab(0)
//滚动条到页面底部加载更多案例
$(window).scroll(function(){
var scrollTop = $(this).scrollTop(); //滚动条距离顶部的高度
var scrollHeight = $(document).height(); //当前页面的总高度
var clientHeight = $(this).height(); //当前可视的页面高度
// console.log("top:"+scrollTop+",doc:"+scrollHeight+",client:"+clientHeight);
if(scrollTop + clientHeight >= scrollHeight){ //距离顶部+当前高度 >=文档总高度 即代表滑动到底部
//滚动条到达底部
alert(3)
}else if(scrollTop<=0){
//滚动条到达顶部
alert(4)
//滚动条距离顶部的高度小于等于0 TODO
}
});
}, },
computed: { computed: {
currentItems: function() { currentItems: function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment