Jquery iPhone网络电话和电子邮件链接
我有一个iPhone应用程序,其中有许多链接,允许用户拨打电话或发送电子邮件Jquery iPhone网络电话和电子邮件链接,jquery,iphone,html,touch,Jquery,Iphone,Html,Touch,我有一个iPhone应用程序,其中有许多链接,允许用户拨打电话或发送电子邮件 <a href="tel:12345678912">Call Us</a> <a href="mailto:support@help.com">Email Us</a> 它不应该工作吗?preventDefault表示您正在阻止链接执行 从您的代码来看,似乎您正在阻止链接被单击,以便可以使用更好的触摸事件。因此,您需要加载成功页面 不是100%确定你的代码是如何工作的,
<a href="tel:12345678912">Call Us</a>
<a href="mailto:support@help.com">Email Us</a>
它不应该工作吗?preventDefault表示您正在阻止链接执行 从您的代码来看,似乎您正在阻止链接被单击,以便可以使用更好的触摸事件。因此,您需要加载成功页面
不是100%确定你的代码是如何工作的,但是如果(!moved){是在点击链接时,你想更改页面,那么就添加window.location=this.href什么不应该工作?你想做什么?我的意思是链接不应该工作吗?它们不工作。好主意。我想不起来。
var after = function(e, sender, action) {
if (href.indexOf("tel:") === 0 || href.indexOf("mailto:") === 0) {
return true;
}
// more of my code
};
if (window.Touch) {
$("a").bind("touchstart", function(e1) {
e1.preventDefault();
var that = $(this);
var moved = false;
that.bind("touchmove", function(e2) {
moved = true;
});
that.bind("touchend", function(e3) {
that.unbind("touchmove");
that.unbind("touchend");
if (!moved) {
after(e3, this, "touchend");
return false;
}
});
});
}
else {
$("a").live("click", function(e) {
e.preventDefault();
after(e, this, "click");
});
}