移动端的touchstart,touchmove,touchend事件中的获取当前touch位置
前提:touchstart,touchmove,touchend这三个事件可以通过原生和jq绑定。
原生:document.querySelector("#aa").addEventListener('touchmove', function(){...});
jq: $(".aa").on("touchmove",function (e) {...};
1.获取当前touch位置
$('#webchat_scroller').on('touchstart',function(e) {
var touch = e.originalEvent.targetTouches[0];
var y = touch.pageY;
});
$('#webchat_scroller').on('touchmove',function(e) {
var touch = e.originalEvent.targetTouches[0];
var y = touch.pageY;
});
$('#webchat_scroller').on('touchend',function(e) {
var touch = e.originalEvent.changedTouches[0];
var y = touch.pageY;
});
移动端的touchstart,touchmove,touchend事件中的获取当前touch位置的更多相关文章
- 手机端touchstart,touchmove,touchend事件,优化用户划入某个可以点击LI的效果
在我们滑动手机的时候,如果LI或者DIV标签可以点击,那么在移动端给用户一个效果 /*id为添加效果LI上的UL的ID,或者是当前DIV的ID*/ function doTouchPublic(id) ...
- touchstart,touchmove,touchend事件 写法
jQuery写法: $('#id').on('touchstart',function(e) { var _touch = e.originalEvent.targetTouches[0]; var ...
- 获取移动端 touchend 事件中真正触摸点下方的元素
移动端的touchstart, touchmove, touchend三个事件,拖动元素结束时,获取到了touchend事件, 但是event.touches[0].target所指向的元素却是tou ...
- touchstart,touchmove,touchend触摸事件的小小实践心得
近段时间使用html5开发一个公司内部应用,而触摸事件必然是移动应用中所必须的,刚开始以为移动设备上或许也会支持鼠标事件,原来是不支持的,好在webkit内核的移动浏览器支持touch事件,并且打包成 ...
- 移动端touchstart,touchmove,touchend
近段时间使用html5开发一个公司内部应用,而触摸事件必然是移动应用中所必须的,刚开始以为移动设备上或许也会支持鼠标事件,原来是不支持的,好在webkit内核的移动浏览器支持touch事件,并且打包成 ...
- touchstart和touchend事件
touchstart和touchend事件 移动互联网是未来的发展趋势,现在国内很多互联网大佬都在争取移动这一块大饼,如微信及支付宝是目前比较成功的例子,当然还有各种APP和web运用. 由于公司的需 ...
- 获取touchstart,touchmove,touchend 坐标
简单说下如何用jQuery 和 js原生代码获取touchstart,touchmove,touchend 坐标值: jQuery 代码: $('#id').on('touchstart',funct ...
- ng-change事件中如何获取$event和如何在子元素事件中阻止调用父级元素事件(阻止事件冒泡)
闲聊: 今天小颖要实现一个当改变了select内容后弹出一个弹框,并且点击select父元素使得弹框消失,这就得用到阻止事件的冒泡了:$event.stopPropagation(),然而小颖发现,在 ...
- JQuery 获取touchstart,touchmove,touchend 坐标
JQuery写法: $('#id').on('touchstart',function(e) { var _touch = e.originalEvent.targetTouches[0]; var ...
随机推荐
- Android阻止AlertDialog关闭
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle("测试" ...
- 将网页发布到远程windows server
1.在vs下利用文件系统发布asp.net文件 2.将生成的所有文件打包成ZIP 3.将zip文件复制并解压到远程windows server的自己创建的文件夹下 4.在windows server上 ...
- [UWP开发]在windows10中设置壁纸~UserProfilePersonalizationSettings
在之前的wp8.1和wp8中,微软没有公开设置壁纸的API,只有一个设置锁屏的API,但在Windows10中,微软为我们提供了设置壁纸的API:TrySetWallpaperImageAsync,他 ...
- console使用技巧
http://heikezhi.com/yuanyi/10%E4%B8%AAchrome%20console%E5%AE%9E%E7%94%A8%E5%B0%8F%E6%8A%80%E5%B7%A7 ...
- ubuntu emacs的安装
在终端依次输入这三条命令即可 sudo add-apt-repository ppa:ubuntu-elisp/ppa sudo apt-get update sudo apt-get install ...
- jQuery中的each, data, 插件
一. each() $(' ').each(function (){...}) jQuery.each(collection, callback(indexInArray, valueOfEleme ...
- 利用C# CefSharp Python采集某网站简历并自动发送邀请短信
以往爬虫没怎么研究过,最近有个需求,要从某网站采集敏感信息,稍稍考虑了一下,决定利用C# Winform和Python一起来解决这个事件. 整个解决方案不复杂:C#编写WinForm窗体,进行数据分析 ...
- Linux中tail指令详解
linux tail命令用途是依照要求将指定的文件的最后部分输出到标准设备,通常是终端,通俗讲来,就是把某个档案文件的最后几行显示到终端上,假设该档案有更新,tail会自己主动刷新,确保你看到最新的档 ...
- Elasticsearch NEST – Examples for mapping between Query and C#
Elasticsearch NEST – Examples for mapping between Query and C# During my training with Elasticsearch ...
- JAVA数组的遍历和取最值
1.获取数组中的所有元素,会用到数组的遍历 数组的遍历,通常用for循环. public class ArrayDemo { public static void main(String[] args ...