sashomaga

Modernizr

Nov 21st, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <title></title>
  5.         <script src="scripts/modernizr-2.6.2-full.js"></script>      
  6.         <style>
  7.         .box {
  8.             width: 200px;
  9.             height: 130px;
  10.             padding: 10px;
  11.             border: 1px solid black;
  12.             border-radius: 15px;
  13.         }
  14.  
  15.             .cssgradients .box {
  16.                 background: #ffffff; /* For old browsers */
  17.                 background: -moz-linear-gradient(top, #ffffff 1%, #000000 100%); /* FF3.6+ */
  18.                 background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffffff), color-stop(100%,#000000)); /* Chrome,Safari4+ */
  19.                 background: -webkit-linear-gradient(top, #ffffff 1%,#000000 100%); /* Chrome10+,Safari5.1+ */
  20.                 background: -o-linear-gradient(top, #ffffff 1%,#000000 100%); /* Opera 11.10+ */
  21.                 background: -ms-linear-gradient(top, #ffffff 1%,#000000 100%); /* IE10+ */
  22.                 background: linear-gradient(to bottom, #ffffff 1%,#000000 100%); /* W3C */
  23.             }
  24.  
  25.             .no-cssgradients .box {
  26.                 background: url('gradient.png') 0 0 repeat-x;
  27.             }
  28.  
  29.             .no-borderradius .box {
  30.                 behavior: url('scripts/PIE_uncompressed.htc');
  31.             }
  32.             </style>
  33. </head>
  34. <body>
  35.     <script>
  36.         /// Modernizr
  37.  
  38.         // polifill == shim == shiv
  39.  
  40.         //1.adds html5shiv if needed(html5 tags in old browsers IE)
  41.  
  42.         //2. Destect html 5 suport throught adding classes to the html element
  43.         // class "js" if js is suported or "no-js" , canvas etc.
  44.         // set classses for all supported (not - supported ) features included in installed packet
  45.  
  46.         //3. Yep/Nope loading of polifills
  47.         // polifill for video tag ... polifill for canvas etc.
  48.         if (Modernizr.canvas) {
  49.             //use canvas
  50.         } else {
  51.             //use canvas alternative
  52.             //or load polifill(modernizr polifills github) or other
  53.         }
  54.        
  55.         Modernizr.load({
  56.             test: Modernizr.audio,
  57.             //yep: my_audio.js,
  58.             nope: 'http://api.html5media.info/1.1.5/html5media.min.js' // i can load differ css here too
  59.         });
  60.         </script>
  61.         <!--[if lt IE 9]>
  62.         <script src="dist/html5shiv.js"></script>
  63.         <![endif]-->
  64.  
  65.    
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment