/ Published in: jQuery
URL: http://blog.3tecky.cz/sklad/ie6alert-500.jpg
this function check browser type and version \r\n\r\nif browser is ie6, display on top of page red box with \"ie6 hate text\" + links to download page new browsers
Expand |
Embed | Plain Text
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 var html = '<div class="ie6alert">' + mainText + links + '</div>' $("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...'); });
You need to login to post a comment.
