Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>02. Canvas</title>
- <script type="text/javascript" src="modernizr-2.6.2.js"></script>
- </head>
- <body>
- <canvas id="myCanvas" style="border:1px solid red; width: 200px; height: 100px;"></canvas>
- <script type="text/javascript">
- var drawRectangle = function() {
- var c = document.getElementById("myCanvas");
- var ctx = c.getContext("2d");
- ctx.fillStyle = "#FF0000";
- ctx.fillRect(0, 0, 150, 75);
- };
- Modernizr.load([{
- test: Modernizr.canvas,
- nope: 'flashcanvas.js',
- complete: function() {
- drawRectangle();
- }
- }
- ]);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement