-2

可能重复:
页面滚动时 IE7 上的问题。文本不正确

当我滚动页面时,搜索按钮不正确。我在这里使用了引导程序。

如果我要减小字体大小并使 font-weight:normal 正常,否则我在 twitter bootstrap 文档中做同样的事情同样的问题来了。

在此处输入图像描述

这是测试服务器的网址

http://www.onetravel.com/travel/test/ot-bootstrap/index.html

如果无法在 ie7 中重现,请发表评论 :-) 提前thanx

4

1 回答 1

2

我无法在 IE7 中重现(IE9 的浏览器和文档模式设置为 7)。

请提供更多信息或可重复的示例,我很乐意提供帮助。

编辑:

似乎当鼠标滚动后进入页面时,它会重绘按钮。根据我的浏览经验,很难注意到。我建议当它变得可见时强制它重绘按钮。

这个小的 jQuery 方法将处理这个问题,尽管可以进行进一步的优化。如果需要调整,请对其进行测试并发表评论。

$('#my-button').RedrawWhenVisible();

$.fn.RedrawWhenVisible = function()
{

    $(window).scroll(function() {
        var docViewTop = $(window).scrollTop();
        var docViewBottom = docViewTop + $(window).height();

        var elemTop = this.offset().top;
        var elemBottom = elemTop + this.height();

        // If element is partially visible...
        if((elemBottom <= docViewBottom && elemBottom >= docViewTop) || (elemTop >= docViewTop && elemTop <= docViewBottom)) {
            //Redraw it, just once.
            if(this.attr('data-redraw')) {                
                this.hide().show();
                // Prevent further draws.
                this.removeAttr('data-redraw');
            }
        } else {
            // The element is not visible...
            if(!this.attr('data-redraw')) {
                // Flag it to redaw on scroll.
                this.attr('data-redraw','redraw');
            }
        }
    }
}

编辑2:

由于另一个按钮很好,我敢打赌这是一个非常具体的 CSS 问题。仔细检查这些 CSS 类的所有属性,灰色按钮很好,因此请检查该按钮与橙色/黄色按钮的不同之处。

于 2012-09-07T14:01:04.403 回答