在表单外单击时,我使用以下内容隐藏 div 和 ovelay div。
以下javascript是:
$(document).mouseup(function (e)
{
var container = $("#feedbackform");
var overlay = $("#overlay");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
$('#feedbackform').fadeOut('fast'),
$('#overlay').fadeOut('fast');
}
});
这在台式机上运行良好,但在触摸移动设备上却不行。
我猜它与mouseup有关,有什么建议吗?
克雷格。