Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="zh-TW">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf8">
- <style>
- div {
- background: #AACCEE;
- border: solid 1px #336699;
- margin: 10px;
- padding: 5px;
- border-radius: 5px;
- display: inline-block;
- text-align: center
- }
- canvas {
- cursor: pointer;
- }
- </style>
- <script src="js/jquery-1.4.2.min.js"></script>
- <script>
- $(document).ready(function() {
- var ctx = $('#canvas')[0].getContext('2d');
- var top = 50;
- $('#paste').bind('click', function(){
- ctx.fillText($('#test').val(), 50, top);
- top += 20;
- });
- });
- </script>
- </head>
- <body>
- <div id="container"><canvas id="canvas" width="640" height="480"></canvas></div>
- <input id="test"><input type="button" id="paste" value="θ²ΌδΈ">
- </body>
- </html>
Add Comment
Please, Sign In to add comment