最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - onlyshow loading image with a transparent back ground in after page submit - Stack Overflow

matteradmin9PV0评论

I want to show a loading image after page submit. I want it to be like , loading image show in the middle of the page and it should have a transparent background to show the page content. I have used following

    #loading {
    position:fixed;
    top:50%;
    left:50%;
    z-index:1104;
    background-color:#999999;
    width:100%;
    height:100%;

    }

Please dont include the javascript part in the answer, I only want to know about styling.

This is not giving background color to the whole page. Please help how can I show a loading image at center of the page and the page content should slightly show.

THanks

I want to show a loading image after page submit. I want it to be like , loading image show in the middle of the page and it should have a transparent background to show the page content. I have used following

    #loading {
    position:fixed;
    top:50%;
    left:50%;
    z-index:1104;
    background-color:#999999;
    width:100%;
    height:100%;

    }

Please dont include the javascript part in the answer, I only want to know about styling.

This is not giving background color to the whole page. Please help how can I show a loading image at center of the page and the page content should slightly show.

THanks

Share Improve this question edited Aug 14, 2012 at 22:05 Oleg 25k8 gold badges64 silver badges94 bronze badges asked Jun 21, 2012 at 6:42 phpgeekphpgeek 476 silver badges13 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Assuming that you want to disable all interactions with content being loaded, you could simply overlay the element and center its background:

#overlay { 
    /*Cover the entire screen regardless of scrolling*/ 
    position:fixed;top:0;right:0;bottom:0;left:0; 
    background: #ff0000 url(...) no-repeat 50% 50%; 
}

Fiddled with a semitransparent bgcolor for demo purposes.

Edit: actually centering an element both vertically and horizontally is hard.

Remove top:50% & left:50%;

http://jsfiddle/qqncv/1/

Post a comment

comment list (0)

  1. No comments so far