开发者

3 active pages and logical preloading using jquery?

i parse pages from a xml-document and build a for each page. i want to look through these pages like a presentation and slides, so only one section is 开发者_Python百科visible at a time. do keep footprint small, i want to implement logical page preloading. e.g. only the previous, the current and the next section is loaded.

[prev][current][next]

how can i realize this in jquery or a mobile framework like zepto (jquery-like)? any advice? thanks!


You have one page visible that is page n. You just have to ensure that at all times you load pages n-1 and n+1 into memory.

So when you initially load the page you load those 3 and show n. Then when you click next you show n+1 and load n+2. The same applies for the previous button.

This doesn't really have anything to do with jQuery or Zepto unless you show us what kind of data you have and in what kind of format you want to show it to us.

At the simplest this can be achieved with a single div and dom nodes stored in an array (memory).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜