手机站也是网站,没有规定你必须要用HTML5技术.
不过一些使用CSS3特性还是蛮不错的:
比如圆角矩形border-radius,
比如过渡动画transition和变换transform.
还有就是触摸事件手机上也会用到:
jQuery Mobile官方提供了一个Alpha版本的Download Builder
可以用来定制自己用到的功能,比如触摸事件(Touch Events):
访问 http://jquerymobile.com/download-builder/
勾选 Events 下的 Touch 然后点击页面下方的 Build My Download 下载.
jquery.mobile.touch.min.js 只有8KB.
Touch events including:
touchstart, touchmove, touchend,
tap, taphold,
swipe, swipeleft, swiperight,
scrollstart, scrollstop
注意:jQuery Mobile 1.4.5 还不支持 jQuery 3,所以可以配合 jQuery 2 使用.
jQuery Mobile Touch Eventsp {margin:0 auto;width:300px;height:100px;background:#E9E9E9;border:1px solid #DDD;}
//$("p").on("swipe",function(){ alert("滑动(swipe)"); });
$("p").on("swipeleft",function(){ alert("向左滑动(swipeleft)"); });
$("p").on("swiperight",function(){ alert("向右滑动(swiperight)"); });
//$("p").on("tap",function(){ alert("点击(tap)"); });
//$("p").on("taphold",function(){ alert("长按(taphold)"); });
下拉刷新+左右滑动+长按菜单,这些功能其实都可以用单击事件click来替代,只是体验不同罢了.