Hi Pete,

First of all, thanks for replying.
loadEntries() will always return 20 results each time. I can't make it
return 20 results one time and 23 results the next time. Basically I want to
call it enough times to fill the whole page with entries so that the scroll
bar shows up. So for a larger screen I would need to call loadEntries() a
few more times than for a smaller screen. How many times loadEntries() is
called depends on screen size.

Basically the goal is to get the scroll bar to show up so that when the user
scrolls my onScroll function is called. Without the scrollbar the onScroll
function doesn't get called and more entries don't load.

Obviously the number of entries loaded onPageLoad can't be static due to
varying user screen sizes.

Basically I was trying to do the following in setup():

start = 0;
getMaxEntries();

var docHeight = document.body.clientHeight;
while(docHeight < window.innerHeight) {
  if(start > 0) {
    loadEntries();
    docHeight += 500;
  }
}

Note: getMaxEntries() sets the value of start. So when getMaxEntries() is
called start will hold the number for the total amount of entries.

But the problem is that the above code gives me a unresponsive script error.

-- Sid

"Veni, vidi, vici"
-----------------------------------
http://blog.sidkalra.com
http://www.sidkalra.com


On Mon, Mar 9, 2009 at 11:59 PM, pedalpete <p...@hearwhere.com> wrote:

>
>
> I hope I understand you problem correctly, a bit difficult to get the
> visual.
>
> Two things you didn't specify
> 1) how many results you expect to get per screen size
> 2) will subsequent requests result number be equal no matter what
> size? or also depend on the screen size?
>
> What i would suggest is to get the window size (I assume we are
> talking length) and see if you can get a number from that. For
> instance 600px/30=20. So if the user had a window height of 600px you
> would get 20 results.
> 800px would give you 23.
>
>
> is that too simplistic for what you're looking for?

Reply via email to