判断IE版本并给出提示升级浏览器
生活随笔
收集整理的這篇文章主要介紹了
判断IE版本并给出提示升级浏览器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| ? | <html> |
| ? | <head> |
| ? | <title>判斷IE版本并給出提示升級瀏覽器</title> |
| ? | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| ? | </head> |
| ? | <style type="text/css"> |
| ? | #ie6-warning{ |
| ? | background:rgb(255,255,225) url("背景圖片地址") no-repeat scroll 3px center; |
| ? | position:absolute; |
| ? | top:0; |
| ? | left:0; |
| ? | font-size:12px; |
| ? | color:#333; |
| ? | width:97%; |
| ? | padding: 2px 15px 2px 23px; |
| ? | text-align:left; |
| ? | } |
| ? | #ie6-warning a { |
| ? | text-decoration:none; |
| ? | } |
| ? | </style> |
| ? | <body> |
| ? | <br /><br /> |
| ? | <!--[if lte IE 6]> |
| ? | <div id="ie6-warning">您正在使用 Internet Explorer 6,在本頁面的顯示效果可能有差異。建議您升級到 <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank">Internet Explorer 8</a> 或以下瀏覽器: <a href="http://www.mozillaonline.com/">Firefox</a> / <a href="http://www.google.com/chrome/?hl=zh-CN">Chrome</a> / <a href="http://www.apple.com.cn/safari/">Safari</a> / <a href="http://www.operachina.com/">Opera</a> |
| ? | </div> |
| ? | <script type="text/javascript"> |
| ? | function position_fixed(el, eltop, elleft){ |
| ? | // check if this is IE6 |
| ? | if(!window.XMLHttpRequest) |
| ? | window.onscroll = function(){ |
| ? | el.style.top = (document.documentElement.scrollTop + eltop)+"px"; |
| ? | el.style.left = (document.documentElement.scrollLeft + elleft)+"px"; |
| ? | } |
| ? | else el.style.position = "fixed"; |
| ? | } |
| ? | position_fixed(document.getElementById("ie6-warning"),0, 0); |
| ? | </script> |
| ? | <![endif]--> |
| ? | </body> |
| ? | </html> |
總結
以上是生活随笔為你收集整理的判断IE版本并给出提示升级浏览器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 移动开发之我见 ——移动WEB
- 下一篇: 2017年html5行业报告,云适配发布