// 滑动监听
$(window).scroll(function() {
var scrollTop = $(this).scrollTop(),
scrollHeight = $(document).height(),
windowHeight = $(this).height(),
seeMore = $('.cpjz-warp .see-more');
if (scrollTop + windowHeight == scrollHeight) {
// 此处写滚动条到底部时候触发的事件
if(seeMore.text()=='加载更多'){
alert('到底了,别滑了!');
}
}
});
//点击查看更多后 添加数据 再改变成下拉加载更多
$('.cpjz-warp .see-more').on('click', function() {
var tableData = '<tr><td><div class="">05-07</div></td><td><div class="">1.0657</div></td><td><div class="">1.0657</div></td><td><div class="color-00c">-0.72%</div></td></tr>';
if($(this).text()=='查看更多'){
for(var i = 0; i < 10; i++) {
$('.cpjz-warp .ws-tbody').append(tableData);
}
};
$(this).text('加载更多').addClass('color-a9b');
});
jq点击查看更多,添加数据之后,改变成下拉加载更多…
随手记