I have the same background image on my whole web application(multi page not single page).Is it possible that background image stays loaded on internal link changes without using ajax?(I don't want to see a blank page between loading pages )

Thank you in advance.

有帮助吗?

解决方案

I guess pure theoretically there will be always be a gap between changing your backround while the parser loads new content into the container. Just the velocity of the engine prevents you to notice this. However... I also guess you know how to change your body backround-image in css as well. All in all your question isn't particulary precise like my redundant answer is.

Here's a proposition I use for (one of) my site(s) in jQuery:

image.fadeOut(300, function(){
if($(window).width()==1920){
image.css("background", "url('../your_pic_here.jpg')");
image.fadeIn(2200);
}

Just think away the fade-stuff and probably it helps your application.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top