如何在ipad上使$(document).on('touchstart')功能起作用?

时间:2012-12-07 14:25:37

标签: javascript jquery

我只是在单击特定按钮时切换类,当用户单击外部文档时我想删除该类。如果我将事件更改为在桌面上单击并测试但在iPad上似乎没有发生任何事情。任何人都可以就如何使这项工作提出任何建议吗?

$shoppingIcon.on('click', function(e) {
        var $this = $(this);
        $this.prev($productInfo).toggleClass('active');
    });

    $(document).on('touchstart', function() {
        $productInfo.removeClass('active');
    });​

0 个答案:

没有答案