我想知道是否有一種方法來阻止滾動條,直到一個div和它的加載器到達顯示none的地步。我不知道這是否可以用HTML或CSS來完成。有什麼建議?如何阻止滾動,直到加載程序不顯示任何內容?
#loader {
background: #eeeeee;
bottom: 0;
height: 100%;
left: 0;
right: 0;
top: 0;
width: 100%;
display:block;
margin: 0 auto;
position: relative;
overflow: hidden;
z-index: 9999;
}
#loaderInner {
background:#eeeeee url(https://dl.dropboxusercontent.com/s/asdfghfdsas/loader.gif) center center no-repeat;
background-size: 250px 250px;
position: absolute;
height: 250px;
width: 250px;
display:block;
margin: 0 auto;
top: 50%;
left: 50%;
margin: -125px 0px 0px -125px;
}
body#layout #loader {
display:none;
overflow: scroll;
}
你可能會需要使用JavaScript來實現這一目標。問題雖然廣泛。你能發佈你正在使用的一組特定的代碼嗎? –
也許是[小提琴](http://www.jsfiddle.net)? –