HTML5有一个重要特性:DeviceOrientation,它将底层的方向和运动传感器进行了高级封装,它使我们能够很容易的实现重力感应、指南针等有趣的功能。本文将结合实例给大家介绍使用HTML5的重力运动和方向传感器实现手机摇一摇效果。
查看演示 下载源码
DeviceOrientation包括两个事件:
1、deviceOrientation:封装了方向传感器数据的事件,可以获取手机静止状态下的方向数据,例如手机所处角度、方位、朝向等。
2、deviceMotion:封装了运动传感器数据的事件,可以获取手机运动状态下的运动加速度等数据。
HTML
页面上有一个div#hand,用来放置一个手摇的图片,d… Read More
The private SSL certificate is an important upgrade to your website. The basic function of an SSL is to encrypt all communication between the browser and the server, ensuring that all data goes through a secure (HTTPS) connection. An SSL certificate is a necessity when you want to operate an online shop and process the
HTML5中,除了其他强大的功能外,同时还增加了audio标签,利用audio标签就可以播放音乐。下面是9个不错的HTML5音乐播放器。
Media Element
MediaElement音频视频播放器是纯HTML5和CSS编写的。同时为很多不同的开源系统提供插件,如WordPress,Drupal,Joomla等
网址:http://mediaelementjs.com/
Scott Andrew’s HTML5 audio player
这个播放器是非常简约,但效果很好。
网址:http://www.scottandrew.com/pub/html5audioplayer/
Speakk… Read More