Skip to content

Instantly share code, notes, and snippets.

@huang-x-h
Last active August 29, 2015 14:06
Show Gist options
  • Save huang-x-h/dd61e28a16144a6249c1 to your computer and use it in GitHub Desktop.
Save huang-x-h/dd61e28a16144a6249c1 to your computer and use it in GitHub Desktop.
(function () {
if (window.ActiveXObject) {
var ua = navigator.userAgent.toLowerCase();
var ie = ua.match(/msie ([\d.]+)/)[1];
if (ie == "6.0") {
var oBox = document.createElement('div');
var oBack = document.createElement('div');
oBox.id = "noie6-wrap";
oBox.innerHTML = '<div class="box"><div class="ico fl"></div><div class="text fl"><p class="px1"></p><p class="px2"></p><div class="link ovl"><a class="fl" href="http://www.firefox.com.cn/download/" id="ff-link" title="下载火狐浏览器"></a><a class="fl" href="https://www.google.com/chrome/" id="chrome-link" title="下载Chrome浏览器"></a><a class="fl" href="http://www.apple.com.cn/safari/" id="safari-link" title="下载Safari浏览器"></a><a class="fl" href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie" id="ie-link" title="下载新版IE浏览器"></a><a class="fl" href="http://www.opera.com/" id="opera-link" title="下载Opera浏览器"></a></div></div></div>';
oBack.id = 'SB-overlayer';
oBack.style.height = getHeight();
document.body.appendChild(oBox);
document.body.appendChild(oBack);
function getHeight() {
return document.body.scrollHeight;
}
var resizeTimer = null;
function doResize() {
oBack.style.height = getHeight();
}
window.onresize = function () {
if (resizeTimer)clearTimeout(resizeTimer);
resizeTimer = setTimeout("doResize()", 300);
};
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment