html开发移动端,做移动端web开发非要html5?

手机站也是网站,没有规定你必须要用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 Events

p {margin:0 auto;width:300px;height:100px;background:#E9E9E9;border:1px solid #DDD;}

jQuery Mobile Touch Events

//$("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来替代,只是体验不同罢了.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值