2010-08-03 69 views
0

我创建一个div在我的网页,它看起来像 -中心DIV元素弹出

<div id="progressThrobber" style="display: none;"><img src="/btweb/images/DeskTopIconLoading.gif" width="200" height ="40"/>    Loading...</div> 

现在这使得它出现在网页上的弹出功能是下面 -

function showProgress(divId) { 
var divElement = document.getElementById(divId); 
divElement.style.display = ''; 
divElement.className='progressThrobberStyle'; 
divElement.innerHTML = '<table><tr><td align="center"><img     src="/btweb/images/DeskTopIconLoading.gif"/></td></tr><tr><td nowrap="nowrap"><b>Loading...</b></td></tr></table>'; 

return true; 

}

用来定位DIV的风格是下方 -

.progressThrobberStyle{ background-color:#FFFFFF; 
    border:1px groove #999999; 
    cursor:default; 
    position:absolute; 
left:50%; 
    top:50%; 
width:200px; height:100px; 
margin:-100px 0 0 -50px; 
    z-index:99; 
    padding: 15px 15px 15px 15px; 
} 

无论用户已经滚动到哪个位置,我都无法将其置于中心位置。例如,如果用户向下滚动到页面的最底部并点击提交,我需要在中心显示弹出窗口。

任何想法?

问候, 卡兰

回答

2

你试过:

position: fixed;