GitHub 地址: https://github.com/panteng/ie-blocker
Block outdated Internet Explorer from your website and display a friendly message of upgrading to modern browsers.
Please visit the websites below with IE 6-9.
Simply download the latest version of IE-Blocker from this page. Unzip the file and place the ie-blocker folder into your projects.
Optionally, you can install IE-Blocker with Bower or Npm:
// With Bower
bower install ie-blocker
// With Npm
npm install ie-blocker
Include ie-blocker.css and ie-blocker.js inside the <head>
tag. Use conditional comments to make these codes only work in old version IE.
<!--[if lte IE 8]>
<link rel="stylesheet" href="ie-blocker/ie-blocker.css">
<script src="ie-blocker/ie-blocker.js"></script>
<![endif]-->
Place the following html code before the closing <body>
tag. You can find the full code in template.html. Use conditional comments to make these codes only work in old version IE.
<!--[if lte IE 8]>
<div id="ib-container">
<div class="ib-modal">
...
</div>
<div class="ib-mask"></div>
</div>
<![endif]-->
That's it.
img-path:
IE-Blocker uses some images to display browser icons. By default, IE-Blocker will look for these images in the img folder which locates at the same path of ie-blocker.js.
So if you want to place these images somewhere else, you need to add an attribute img-path to script tag. For example:
<!--[if lte IE 8]>
<link rel="stylesheet" href="ie-blocker/ie-blocker.css">
<script src="ie-blocker/ie-blocker.js" img-path="../images/browser_icons/"></script>
<![endif]-->
Remember the img-path is relative to ie-blocker.js, not the html file.
Do not forget the '/' at the end.
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.