在jquery中mousedown / mouseup为ipad工作吗? [英] does mousedown /mouseup in jquery work for the ipad?

查看:128
本文介绍了在jquery中mousedown / mouseup为ipad工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用当前代码:

$('body').mousedown(function() {
        $('div#extras').fadeTo('fast', 1);
});

$('body').mouseup(function() {
        $('div#extras').delay(2000).fadeTo(1500, 0);
});

这在safari中效果很好但是当我上传并在ipad上查看它时它不起作用?

This works great in safari but when I upload it and check it out on the ipad it doesnt work?

推荐答案

我发现如何为感兴趣的人提供ipad:

I found out how to do this for the ipad for those who are interested:

而不是我在我的问题中使用的代码,你会使用:

Instead of the code I used in my question, you would use:

$('body').bind( "touchstart", function(e){
        $('div#extras').fadeTo('fast', 1);
});

&

$('body').bind( "touchend", function(e){
        $('div#extras').delay(2000).fadeTo(1500, 0);
});

这篇关于在jquery中mousedown / mouseup为ipad工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆