首页 新闻 赞助 找找看

Android App html页面 怎么让它滑动到页面底部 跳转到另外的页面

0
[已解决问题] 解决于 2017-06-05 11:10

求大神 帮忙

html页面使用在Android APP里  怎么让它的页面滑动到底部 跳转到另外的页面呢  

web
问题补充:

$(window).scroll(function(){
  var scrollTop = $(this).scrollTop();
  var scrollHeight = $(document).height();
  var windowHeight = $(this).height();
  if(scrollTop + windowHeight == scrollHeight){
    window.location.href="operate2.html";
  }
if(scrollTop==0){
window.location.href="product.html"
}
});

这个不行 为什么

叶艾文的主页 叶艾文 | 菜鸟二级 | 园豆:206
提问于:2017-03-21 16:21
< >
分享
最佳答案
0

刚刚试了一下,你windowHeight可能得到的不是原来窗口的高度,而且我也觉得你不是用手机来真测吧,所以才会有这个问题。

$(window).scroll(function(){
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
$("body").append("<s class='c'></s>");
var windowHeight=$(".c").css({"position":"fixed", "top":"0", "bottom":"0", "left":"0", "right":"0"}).height();
if(scrollTop + windowHeight == scrollHeight){
window.location.href="operate2.html";
}
if(scrollTop==0){
window.location.href="product.html"
}
$(".c").remove();
});

奖励园豆:5
kimingw | 菜鸟二级 |园豆:216 | 2017-03-21 18:12

谢谢   还是不行

叶艾文 | 园豆:206 (菜鸟二级) | 2017-03-22 10:02
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册