开发者

Part of a page to stay loaded throughout the website

I was wondering if it was possible to have one element only loaded once upon visiting my website.

In other words, I have a <div> which contains a bunch of different spritely backgrounds, and I was wondering if I could only have that single <div> load once, and then, each time an end-user loads a different page, that <div> stays the same.

The effect I would like to achieve is to not have the animation start over.

How hard is this to implement, and how exactly do I do this? Is this too much of a hassle to quickly implement? Also, I 开发者_JAVA百科believe this has something to do with Ajax, is that right?

Thanks!


Also, I believe this has something to do with Ajax, is that right?

You can update your entire site except your div "with ajax", i.e. without refreshing the page. This implies, that your website must be a kind of javascript application. If it isn't already, you'll need to rewrite some (or more) parts.


A more simple solution may be to use your server side code to determine if the page request is the first, or a subsequent request, and show a static background for these subsequent requests.

This can be done in a few lines in most server-side languages. Which are you using?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜