Hi I m 寻求一种途径,检测用户在引发事件之前的网页上(实时)有多少个餐厅。
我走过了这一法典,这是我之后的一件大事,但我需要收集整页,而不仅仅是一页。 我可以把四舍五入到整个网页的大小,因为它需要在单Pads/iPhones等上加油。
<head>
<script type="text/javascript">
function OnScrollDiv (div) {
var info = document.getElementById ("info");
info.innerHTML = "Horizontal: " + div.scrollLeft
+ "px<br/>Vertical: " + div.scrollTop + "px";
}
</script>
</head>
<body>
<div style="width:100px;height:200px; overflow:auto;" onscroll="OnScrollDiv (this)">
Please scroll this field!
<div style="height:300px; width:100px; background-color:#ccc;"></div>
Please scroll this field!
<div style="height:300px; width:100px; background-color:#ccc;"></div>
Please scroll this field!
</div>
<br /><br />
Current scroll amounts:
<div id="info"></div>
</body>
An example of what i m after can be found at http://www.nikebetterworld.com/ Any help will be much appreciated.
Edit: it s at the bottom of the page!