Results for crossbrowser : 5

3 - BodyClasses
# Renvoie un attribut class complet (navigateur navigateur+version nom de la page sans extension)
# ex class="Firefox Firefox23 index" 
# utile pour apporter des corrections de style en fonction de la page et de la version du navigateur
# On peut ajouter ses propres classes via cette fonction: BodyClasses('maclasse'); 
function BodyClasses($other_classes=''){    
        $regex='#(msie)[/ ]([0-9])+|(firefox)/([0-9])+|(chrome)/([0-9])+|(opera)/([0-9]+)|(safari)/([0-9]+)|(android)|(iphone)|(ipad)|(blackberry)|(Windows Phone)|(symbian)|(mobile)|(bada])#i';
        preg_match($regex,$_SERVER['HTTP_USER_AGENT'],$resultat);          
        echo ' class="'.preg_replace('#([a-zA-Z ]+)[ /]([0-9]+)#','$1 $1$2',$resultat[0]).' '.basename($_SERVER['PHP_SELF'],'.php').' '.$other_classes.'" ';     
}

			
4 - Font Stacks | CSS-Tricks
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;

/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;

/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;

/* Helvetica/Arial-based sans serif stack */
font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;

/* Verdana-based sans serif stack */
font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;

/* Trebuchet-based sans serif stack */
font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif;

/* Impact-based sans serif stack */
font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif;

/* Monospace stack */
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;


			
5 - placeholder avec fallback jquery
<script type="text/javascript">jQuery(function($){
    var isPlaceholderSupported = function () { 
        var o = document.createElement('input'); 
        return "placeholder" in o; 
    };
    if (!isPlaceholderSupported()) {
        var togglePlaceholderText = function (el) {    
            var color = '#999';
            var v = $.trim(el.val());
            var p = el.attr('placeholder'); 
            if (v == '') { 
                el.val(p); 
                el.css({'color':color}); 
            } else if (v == p) {
                el.val(''); 
                el.css({'color':''});
            } 
        };
        $('input[placeholder]')
            .each(function(){togglePlaceholderText($(this));})
            .click(function(){togglePlaceholderText($(this));})
            .blur(function(){togglePlaceholderText($(this));})
            .closest('form').submit(function(){$(this).find('input[placeholder]').each(function(){togglePlaceholderText($(this));})});
    }

    //alert pour montrer que cela fonctionne
    $('form').submit(function(){
        alert($(this).serialize());
    });
});
</script>