CSS中可以定义大小的单位有四种px,pt,em,rem,而px可以说在网页开发中最常见的单位了。不过现在如今的大多数网站已经开始用rem这个单位了。那么这四个单位有什么区别呢?
px|pt|em|rem区别
px单位
px(像素),国内网站相对来说用得比较多,任意浏览器的默认字体高都是16px。[……]
技术 & 投资 & 管理
CSS中可以定义大小的单位有四种px,pt,em,rem,而px可以说在网页开发中最常见的单位了。不过现在如今的大多数网站已经开始用rem这个单位了。那么这四个单位有什么区别呢?
px(像素),国内网站相对来说用得比较多,任意浏览器的默认字体高都是16px。[……]
在JS中,数组使用构造函数Array()和运算符new创建的。一般,我们用三种不同的方式来调用Array()创建数组。
第一种方式是无参调用:
var a=new Array();
它创建的是一个没有元素的空数组。
[……]
在JavaScript中,任何合法的函数都可以作为对象的构造函数,这既包括系统内置函数,也包括用户自己定义的函数。一旦函数被作为构造函数执行,它内部的this属性将引用函数本身。
通常来说,构造函数没有返回值,它们只是初始化由this指针传递进来的对象,并且什么也不返回。如果一个函数有返回值,[……]
JS中实现实现继承的机制不止一种,这是因为JS中的继承机制并不是明确规定的,而是通过模仿实现的。这意味着所有的继承细节并非完全由解释程序处理。作为开发者,我们有权决定最适用的继承方式。
1.构造继承法。
构造继承法是使用了FUNCTION对象的call和apply方法[……]
我们知道,JS是面向对象的。谈到面向对象,就不可避免的要涉及类的概念。一般像c#,java这些强类型语言都有固定的定义类的语法。而JS的不同之处在于它能使用各种方法实现自己的类和对象。一般的实现有以下几种方式:
1.工厂方式
工厂方式是指创建一个返回特定对象类型的工厂[……]
iScroll 4 这个版本完全重写了iScroll这个框架的原始代码。这个项目的产生完全是因为移动版webkit浏览器(诸如iPhone,iPad,Android 这些系统上广泛使用)提供了一种本地化的方式来对一个限定了高度和宽度的元素的内容进行滑动。很不幸的是,这种情况下所有的web应用的页面就[……]
jquery mobile是一个好框架,虽然我没用过Sencha Touch,但据说学习成本要比jq mobile大很多,从目前web app ui框架选择少的情况来看,jq mobile是最好的选择。
jquery本身已是一个成熟的框架,jq mobile作为它的附属,继承了 write less[……]
Shortlists of China HTML5 Game Programming Contest:
1. SavePAPA: it’s a very good HTML5 puzzle game using Box2D JS to achieve physical collision effect. It mainly leverages HTML5 Canvas. The developer got success from their Flash game development experience. And they had improve the source code of Box2D to optimize the performance. They win the first prize in the end.
http://game.mhtml5.com/game/works/72Fu9F8ApmrWmmPb/
2. Happy Ghost Wars: it’s a HTML5 Adventure Game and mainly leverages Canvas, Audio and Local Storage. Two members finished this game in two week during their spare time. They designed this game for they both like Happy Ghost serial movies. They are planning to develop a social version of this game and will publish it to Facebook and Renren.com.
http://game.mhtml5.com/game/works/bXxhCzUISwMhGUpx/
3. The rabbit’s travel: it’s a HTML5 Adventure Game and mainly leverages Canvas, Audio and Motion control. 8 members finished this game in 20 hours and it runs well in iOS, Android and Desktop browsers.
http://game.mhtml5.com/game/works/2SsnaWQAWc1DwOtD/
4. 3D Bomb Man: it’s a HTML5 3D Action Game and mainly leverages WebGL, Audio and Local Storage. The author finished this game with the JS3D engine which developed by himself and the performance is good in desktop browsers.
http://game.mhtml5.com/game/works/45a9ntP5aTkDO8Z4/
5. Shooter: it’s a HTML5 Shooting Game and mainly leverages HTML5 Canvas. The developer is a college student and finished this game during his spare time. There are spectacular special effects in this game.
http://game.mhtml5.com/game/works/xfNk8MaEm2DdOgp1/
During the conference, He Huang, CEO of Leiyoo, announced their first MMOSLG game "Twilight Empire", which can be run on WinPhone, iOS and Android. One of their frontend architects, Guo Zhao, shared the design of their game framework (Core + Plugins + UI libraries + map/animation/level editors) and technical issues (screen resolution, traffic control) in implementation. This framework mainly leverages Canvas, Manifest (Off-line Storage), WebSocket and CSS3.
Guangyu Qi, who comes from Microsoft IE9 product team, introduced the features in Win8 and HTML5 support in IE9. He showed a live demo about the excellent support for large numbers of sound tracks in IE9, compared with the poor performance in Chrome and Firefox.
[……]