-2

私は2Dスクロールビュー内にあるWebビューで作業しているので、computescrollrange()、computescrolloffset()などを取得しようとすると、これらのメソッドは値を返さないので、javascriptを使用して水平スクロールバーが到達したことを検出したいwebviewの終わりなので、Androidまたはjavascript/jqueryのいずれかで最後にあるかどうかを判断するためにブール値を返す関数を作成する方法を教えてください

4

2 に答える 2

0
<!DOCTYPE html>
<html>

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Scroll Detect</title>
<script type="text/javascript">
var cxs=0;
var cys=0;
window.onscroll=function (){
if ('scrollMaxX' in window){
sym=window.scrollMaxY;
}
else{
sym = document.documentElement.scrollHeight - document.documentElement.clientHeight;
}
if ('pageXOffset' in window) {// all browsers, except IE before version 9
cys=window.pageYOffset;
}
else {  // Internet Explorer before version 9    
cys=document.documentElement.scrollTop;
}

if(cys==sym&&sym>0){alert("The horizontal scroller in the bottom")}
}
</script>
</head>
<body>
于 2013-05-08T18:46:26.353 に答える