滚动不在IE8中工作 [英] Scrolling not working in IE8

查看:297
本文介绍了滚动不在IE8中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有IE8(版本:8.0.6001.18702)和我自己无法解决的网站(gute-tat.de)的问题。在所有其他浏览器中滚动很好,但在IE8中,滚动只能偶尔使用或根本不运行。我无法通过stackoverflow或google找到解决方案。

iI have a problem with IE8 (Version: 8.0.6001.18702) and this website (gute-tat.de) that I'm unable to solve on my own. In all other browsers scrolling is fine, but in IE8 scrolling only works occasionally or not at all. I couldn't find a solution via stackoverflow or google.

我试图通过验证网站并修复所有错误来解决问题。此页面只剩下2个错误 http://www.gute-tat.de/konzept.html ,仍然滚动仍然是腐败的。
剩下的两个错误之一,onLoad - 错误也不是原因。我暂时将其删除,并在没有解决问题后将其重新放入。 (我刚接过维护这个网站的工作,所以我不想太快地做太多更改)

I tried to fix the problem by validating the site and fixing all errors. This page has only 2 errors left http://www.gute-tat.de/konzept.html, still scrolling remains corrupt. One of the two remaining errors, the "onLoad"-error isn't the cause either. I removed it temporarily and put it back in after it didn't solve the problem. (I just took over the job of maintaining this site, so I don't want to make too many changes too quick)

我也想改变doctype,但是Typolight只允许在XHTML Strict和XHTML Transitional之间进行选择。

I also wanted to change the doctype, but Typolight only allows to choose between "XHTML Strict" and "XHTML Transitional".

如果有人能指出我正确的方向,这将是我的一天。

It would make my day if somebody could point me in the right direction.

提前致谢,
Stephan

Thanks in advance, Stephan

推荐答案

问题是由全屏背景图片,通过表格实现。

The problem is caused by the fullscreen background image, realized via a table.

<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>

只要鼠标指针停留在背景图像上,滚动就会被打破。如果鼠标指针放在实际内容的顶部,滚动工作正常。

Scrolling is only broken as long as the mouse pointer resides over the background image. If the mouse pointer is placed on top of the actual content, scrolling works fine.

我知道表是实现全屏背景图像的错误方法,但我不知道它导致滚动不能在IE8中工作(至少在这种情况下)。

I know that a table is the wrong method to realize a fullscreen background image, but I didn't know that it causes scrolling not to work in IE8 (at least in this case).

我无法在合理的时间内找到确切的部分背景导致问题。因为我会用更新的方法替换表格,所以我不想浪费更多时间。但是,如果有人可以分享更多关于此的见解,我将不胜感激。

I couldn't find out in reasonable time which exact part of the background causes the problem. Since I will replace the table with a more up-to-date method anyway, I don't want to waste more time on it. If however, someone can share more insight on this, I would appreciate it.

这是相关的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%;
}

这篇关于滚动不在IE8中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆