Loading Canvas
下面是一个loading Canvas的实例
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <title>Canvas Loading</title> <script type="text/javascript"> var ctx; var drawIntervalID; var spokes = 12;// 设置叶片数量function init() { var canvas = document.getElementById('myCanvas'); if (canvas.getContext){ ctx = canvas.getContext('2d'); ctx.translate(15,15);// 设置中心点ctx.lineWidth = 1;//设置叶片宽度ctx.lineCap = "square"//设置叶片形状有3个选择 “butt" "round" "square" drawIntervalID = setInterval(draw,100);//设置定时器return drawIntervalID; } } function draw(){ ctx.clearRect(-20,-20,30,30);// 输出图像ctx.rotate(Math.PI*2/spokes);// 开始旋转for (var i=0; i<spokes; i++) { ctx.rotate(Math.PI*2/spokes);// 开始旋转ctx.strokeStyle = "rgba(255,255,255,"+ i/spokes +")";//设置叶子颜色渐变 ctx.beginPath(); ctx.moveTo(0,3); ctx.lineTo(0,8); ctx.stroke(); } } </script> <style type="text/css"> .canvas_bg{width:30px; height:30px; position:absolute; left:0; top:0; background:#000;filter:Alpha(opacity=70);opacity: 0.7;} #myCanvas{position:absolute; left:0; top:0; z-index:2;} </style> </head> <body onLoad="init();"> <div class="canvas_bg"></div> <canvas width="30" height="30" id="myCanvas"></canvas> </body> </html>
Zepto.js is a minimalist JavaScript framework for mobile WebKit browsers, with a jQuery-compatible syntax. The goal: a 2-5k library that handles most basic drudge work with a nice API so you can concentrate on getting stuff done. Zepto.js is currently in early beta, and you can help to make it awesome by contributing code, documentation and demos.
DHTMLX Touch is an HTML5-based JavaScript library for building mobile web applications. It’s not just a set of UI widgets, but a complete framework that allows you to create eye-catching, cross-platform web applications for mobile and touch-screen devices.
Sencha Touch, the first HTML5 mobile JavaScript framework that allows you to develop mobile web apps that look and feel native on iPhone and Android touchscreen devices, has just hit the big 1.0. And best of all, it’s completely free to use.
A unified user interface system across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.
A jQuery plugin for mobile web development on the iPhone, iPod Touch, and other forward-thinking devices.
Wink toolkit is a mobile JavaScript framework for building webapps on iPhone, iPad and Android
iUI is a framework consisting of a JavaScript library, CSS, and images for developing advanced mobile webapps for iPhone and comparable/compatible devices.
iWebKit is a file package designed to help you create your own iPhone, iPod Touch and iPad compatible website or webapp.
WebApp.Net is a light weight, powerful javascript framework taking advantage of AJAX technology. It provides a full set of ready to use components to help you develop, quickly and easily, advanced mobile web applications.
