jQuery:IE6警报
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery:IE6警报相关的知识,希望对你有一定的参考价值。
this function check browser type and version if browser is ie6, display on top of page red box with "ie6 hate text" + links to download page new browsers
jQuery.ie6Alert = function(mainText) { if($.browser.msie && $.browser.version=="6.0") { // if($.browser.msie && $.browser.version <= 6 ) var links = '<div>Nainstalujte si: ' // install + '<a href="http://www.microsoft.com/ie8/">IE8</a> nebo ' // ie8 or + '<a href="http://www.mozilla-europe.org/cs/firefox/">Firefox</a> nebo ' // firefox or + '<a href="http://www.opera.com/download/">Operu</a> nebo ' // opera or + '<a href="http://www.google.com/chrome/">Chrome</a> nebo ' // chrome or + '<a href="http://www.apple.com/safari/download/">Safari</a> ' // safari + '- proste neco novejsiho...</div>'; // simple another new browser $("body").prepend(html) // add css to div.ie6alert $('.ie6alert') .css("color", "#D8000C") .css("border", "0") .css("border-bottom", "1px solid") .css("margin", "0") .css("padding", "1em 5em") .css("font", "normal 2em Helvetica, Arial, sans-serif") .css("text-align", "center") .css("background-color", '#FFBABA'); // add css to div with links $('.ie6alert div') .css('margin-top', '10px') .css("font-size", "0.5em"); // add css to link $('.ie6alert div a') .css('color', '#D8000C') .css('font-weight', 'bold') .css('letter-spacing', '0.1ex'); } } // start with $(document).ready(function(){ $.ie6Alert('This web hate IE6, browser from year 2001...'); });
以上是关于jQuery:IE6警报的主要内容,如果未能解决你的问题,请参考以下文章