firefox, hack, ie, javascript, jquery
ie sucks – black’n’white
17 June 2008 | CommentsDa un idea di Andy Clarke.
Grazie alla segnalazione di Simone.
Da oggi questo sito verrà visualizzato in bianco e nero da tutti gli utenti che utilizzano ancora internet explorer 6.
Non ho la forza, ne la voglia di spiegare cosa non vada in ie. In ie6 come in ie7… e tra poco in ie8.
Internet explorer dovrebbe sparire. Ma questi sono sogni…
Per chi volesse aderire alla campagna “bianco e nero su ie” può usare un paio di tecniche.
1) SOLUZIONE CSS PURA
Css (anche se un bel if IE senza troppi maggiori/minori….):
<!--[if lt IE 7]> <link rel="stylesheet" href="ie6.css" type="text/css" media="all"></link> <![endif]-->
e all’interno del css:
html{filter:gray;}
2) SOLUZIONE JS JQUERY
Js – dopo aver incluso la libreria jQuery, in un tag “script” o in un js incluso inserire la seguente funzione
jQuery(document).ready(function(){
if(jQuery.browser.msie && jQuery.browser.version < 7)
jQuery("html").css("filter","gray");
});
3) SOLUZIONE JS PURA
window.onload = function(){if(document.all)document.all.tags('html')[0].style.setAttribute('filter','gray()','false')};
This entry was posted in firefox, hack, ie, javascript, jquery and tagged css, firefox, ie, javascript. Bookmark the permalink.
← Firefox 3… (waiting for Epiphany and webkit) black’n'white 1.0 →