評論我無法重現IE7(瀏覽器和文檔模式設置爲7的IE9)。
請包含更多信息或可複製的示例,我很樂意提供幫助。
編輯:
看來,再用鼠標滾動後進入的頁面時,重繪按鈕。根據我的瀏覽體驗,很難注意到。我建議force it to redraw按鈕when it becomes visible。
儘管可以進一步優化,但這個小的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類的所有屬性,灰色按鈕是否正常,請檢查該按鈕與橙色/黃色按鈕的不同。
哎downvoters ??請問? – supersaiyan