检测到IE浏览器进行弹窗提示
中文提示
<style> .ie-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 99999; display: -ms-flexbox; display: flex; -ms-flex-pack: center; justify-content: center; -ms-flex-align: center; align-items: center; } .ie-content { background: white; padding: 2rem; border-radius: 8px; text-align: center; max-width: 500px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); box-sizing: border-box; } .ie-content button { margin-top: 1rem; padding: 0.5rem 1.5rem; background: #2563eb; color: white; border: none; border-radius: 4px; cursor: pointer; } body.ie-block { overflow: hidden !important; height: 100%; } html.ie-block { overflow: hidden !important; } </style>
<script> if (navigator.userAgent.indexOf("MSIE") !== -1 || navigator.userAgent.indexOf("Trident") !== -1) { var mask = document.createElement('div'); mask.className = 'ie-mask'; mask.innerHTML = '<div class="ie-content">' + '<h2>浏览器不兼容提示</h2>' + '<p>您正在使用旧版浏览器,部分功能无法正常使用</p>' + '<p>请使用360浏览器、搜狗浏览器、百度浏览器、Chrome浏览器、Edge浏览器、Firefox浏览器等访问</p>' + '</div>'; document.documentElement.style.overflow = 'hidden'; document.documentElement.className += ' ie-block'; document.body.className += ' ie-block'; document.body.appendChild(mask); if (mask.attachEvent) { mask.attachEvent('onwheel', function(e) { e.returnValue = false; }); mask.attachEvent('onmousewheel', function(e) { e.returnValue = false; }); } window.removeMask = function() { mask.parentNode.removeChild(mask); document.documentElement.style.overflow = ''; document.documentElement.className = document.documentElement.className.replace(' ie-block',''); document.body.className = document.body.className.replace(' ie-block',''); } } </script>英文提示
<style> .ie-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 99999; display: -ms-flexbox; display: flex; -ms-flex-pack: center; justify-content: center; -ms-flex-align: center; align-items: center; } .ie-content { background: white; color: #000; padding: 2rem; border-radius: 8px; text-align: center; max-width: 500px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); box-sizing: border-box; } .ie-content button { margin-top: 1rem; padding: 0.5rem 1.5rem; background: #2563eb; color: white; border: none; border-radius: 4px; cursor: pointer; } body.ie-block { overflow: hidden !important; height: 100%; } html.ie-block { overflow: hidden !important; } </style>
<script> if (navigator.userAgent.indexOf("MSIE") !== -1 || navigator.userAgent.indexOf("Trident") !== -1) { var mask = document.createElement('div'); mask.className = 'ie-mask'; mask.innerHTML = '<div class="ie-content">' + '<h2>Browser Compatibility Warning</h2>' +
'<p>You are using an outdated browser. Some features may not work properly.</p>' +
'<p>Please access this site using Chrome, Edge, Firefox or modern browsers.</p>' + '</div>'; document.documentElement.style.overflow = 'hidden'; document.documentElement.className += ' ie-block'; document.body.className += ' ie-block'; document.body.appendChild(mask); if (mask.attachEvent) { mask.attachEvent('onwheel', function(e) { e.returnValue = false; }); mask.attachEvent('onmousewheel', function(e) { e.returnValue = false; }); } window.removeMask = function() { mask.parentNode.removeChild(mask); document.documentElement.style.overflow = ''; document.documentElement.className = document.documentElement.className.replace(' ie-block',''); document.body.className = document.body.className.replace(' ie-block',''); } } </script>
