简体   繁体   中英

Background image loaded on page change

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM