手机页面touch触摸事件
2016-12-19 10:54
483 查看
请看示例:
延伸阅读文章: http://www.w3school.com.cn/jquerymobile/jquerymobile_events_touch.asp
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <style> .main-div{ font-size:4rem; width:100%; } </style> <script type="text/javascript" src="jquery-2.1.1.js"></script> </head> <body> <div class="main-div"> hello wor1ld! </div> </body> </html> <script type="text/javascript"> $(".main-div").bind("touchstart", function (e) { //触摸开始的时候触发 //e.preventDefault(); //阻止出现滚动条 $(this).css("background-color", "#e5e5e5"); }).bind("touchend", function (e) { //手指在屏幕上滑动的时候触发 $(this).css("background-color", "white"); }).bind("touchmove", function (e) { //触摸结束的时候触发 $(this).css("background-color", "white"); }); </script>
延伸阅读文章: http://www.w3school.com.cn/jquerymobile/jquerymobile_events_touch.asp
相关文章推荐
- 用touchStart事件代替click处理手机页面上的触摸事件
- 用touchStart事件代替click处理手机页面上的触摸事件
- JS事件监听手机屏幕触摸事件 Touch
- JS事件监听手机屏幕触摸事件 Touch
- [置顶] touch事件(监听手机屏幕触摸事件)
- 打印touch事件,打印手机触摸事件
- JS事件监听手机屏幕触摸事件 Touch
- 打印touch事件,打印手机触摸事件
- Vue.js移动端左滑demo和JS事件监听手机屏幕触摸事件 Touch
- 与众不同 windows phone (24) - Input(输入)之软键盘类型, XNA 方式启动软键盘, UIElement 的 Touch 相关事件, 触摸涂鸦
- android触摸事件传递机制以及onInterceptTouchEvent()和onTouchEvent()总结
- starling教程-触摸事件(Touch Events)
- jQueryMobile的(十八) 触摸事件(touch)
- Cocos-2d 关于SwallowTouch,进一步解释触摸事件分发机制
- UIScrollView touch 触摸事件
- 手机web开发,click,touch,tap事件浅析
- cocos2d ccLayer响应触摸事件方法:CCStandardTouchDelegate 与 CCTargetedTouchDelegate
- cocos2d ccLayer响应触摸事件方法:CCStandardTouchDelegate 与 CCTargetedTouchDelegate
- 触摸三事件touchstart,touchend,touchmove
- starling教程-触摸事件(Touch Events)