HTML5CSS3HTML5CSS3!
HTML5, CSS3 CanvasWebSocket Web HTMLCSS JavaScript HTML5 HTML5 HTML5 HTML5 Web
Modernizr HTML5
Canvas
:
window.onload = function () {
if (canvasSupported()) {
alert(‘canvas supported’);
}
};
function canvasSupported() {
var canvas = document.createElement(‘canvas’);
return (canvas.getContext && canvas.getContext(‘2d’));
}
:
window.onload = function () {
if (localStorageSupported()) {
alert(‘local storage supported’);
}
};
function localStorageSupported() {
try {
return (‘localStorage’ in window && window[‘localStorage’] != null);
}
catch(e) {}
return false;
}
Modernizr
免费云主机、域名Moderizr HTML5 JS
Modernizr http://modernizr.com JS JS
2015625153003697.png (690533)
Modernizr JS
:
HTML
Modernizr CSS no-FeatureName no-flexbox chrome
:
JavaScript
:
HTML5 Boilerplate (http://html5boilerplate.com) Initializr (http://initializr.com) no-js JavaScript
HTML5 CSS3
CSS CSS
:
.boxshadow #MyContainer {
border: none;
-webkit-box-shadow: #666 1px 1px 1px;
-moz-box-shadow: #666 1px 1px 1px;
}
.no-boxshadow #MyContainer {
border: 2px solid black;
}
box-shadows boxshadow CSS no-boxshadow box-shadow
Modernizr Canvas
:
$(document).ready(function () {
if (Modernizr.canvas) {
//Add canvas code
}
if (Modernizr.localstorage) {
//Add local storage code
}
});
Modernizr CSS3
:
$(document).ready(function () {
if (Modernizr.borderradius) {
$(‘#MyDiv’).addClass(‘borderRadiusStyle’);
}
if (Modernizr.csstransforms) {
$(‘#MyDiv’).addClass(‘transformsStyle’);
}
});
Modernizr
,,shim/polyfill (shims/polyfills, https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills). Modernizr,,. Modernizr,yepnope(http://yepnopejs.com). ,,.
Modernizrload(),(test), (yep), (nope), (both). load():
:
Modernizr.load({
test: Modernizr.canvas,
yep: ‘html5CanvasAvailable.js’,
nope: ‘excanvas.js’,
both: ‘myCustomScript.js’
});
Modernizrcanvas . HTML5 canvashtml5CanvasAvailable.js myCustomScript.js (yep – load() ). , excanvas.js polyfillIE9 . excanvas.js,myCustomScript.js.
Modernizr, . , GoogleCDNModernizr. ModernizrCDNjQuery:
Google CNDjQuery. (). jQuery,jQuery. needs-jQuery.js.HTML5CSS3
相关推荐: JavaScript常见的Number对象有哪些
本篇内容主要讲解“JavaScript常见的Number对象有哪些”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“JavaScript常见的Number对象有哪些”吧!Number 对象是原始数值的包装对象。Numb…