問題是由全屏背景圖像引起的,通過表格來實現。
<body>
<div id="mainwrapper">
<!-- the actual conent of the page... -->
</div>
<div id="bg">
<div>
<table cellspacing="0" cellpadding="0">
<tbody><tr><td>
<img alt="" src="pathtobackgroundimage/bg_image.jpg">
</td></tr></tbody>
</table>
</div>
</div>
</body>
只要鼠標指針位於背景圖像上,滾動就會中斷。如果鼠標指針位於實際內容的頂部,則滾動工作正常。
我知道一張桌子是實現全屏背景圖像的錯誤方法,但我不知道它導致滾動不能在IE8中工作(至少在這種情況下)。
我無法在合理的時間內找出背景的確切部分導致問題。因爲無論如何我會用更新的方法替換表格,我不想浪費更多時間。但是,如果有人可以分享更多的見解,我將不勝感激。
下面是相關的CSS
html, body, #bg, #bg table, #bg td {
height: 100%;
overflow: hidden;
width: 100%;
}
#bg div {
height: 200%;
left: -50%;
position: absolute;
top: -50%;
width: 200%;
}
html, body, #bg, #bg table, #bg td {
height: 100%;
overflow: hidden;
width: 100%;
}
#bg td {
text-align: center;
vertical-align: middle;
}
#bg img {
margin: 0 auto;
min-height: 50%;
width: 50%;
}
高興你理解了它,並感謝張貼您的解決方案,幫助了我很多! – 2013-10-18 07:40:06