Is there a limit to the scroll length of a web page?
I have a client who is building a business application that will be used with IE8 only.
One of the requirements is to display all of the data in a single page. I am anticipating this data table to be somewhere between 3K - 10K pixels in length. In the worst case scenarios, more than 25K pixels.
What are the technical considerations when serving a page that long? Is there a limit on page length and IE would d开发者_如何学Cisplay a error?
The application is Java/Struts based.
Try using this Javascript:
<html>
<head>
<script>
window.onload=function(){
var i=10000;
var buff='';
while(--i){
buff+='<br />';
}
document.body.innerHTML=buff;
}
</script>
</head>
</html>
The theoretical answer: Your machine resources are finite - so yes, there's a limit.
The practical answer: Take a look at other very long pages, e.g. http://svnbook.red-bean.com/en/1.5/svn-book.html
Try it with:
<%
for (int i = 0; i < 25000; i ++) {
%>test<br /><%
}
%>
IE10 stops at just under 1534000px in my testing. The limit includes the height of the viewport into the scrollable area so the actual scrollTop is the limit minus the height of the element.
If you set CSS style -ms-scroll-limit-y-max it will clamp at the maximum allowed value, it seems. But in my case I stumbled on this number by accident.
精彩评论