我有问题,我在位置上修复了元素,点击后启用模态: Here is demo
JS:
$(document).on('click', '.open', function(){
$(this).toggleClass('active');
});
$(document).on('click', '.modal, .modal-close', function(){
$('.open').removeClass('active');
});
$(document).on('click', '.modal-content', function(e){
e.stopPropagation();
});
点击圈我用jquery打开modal,在android上运行正常,但iPhone不检测点击事件。我怎么修这个?
答案 0 :(得分:0)
<强> Updated fiddle 强>
尝试将touch
也添加到活动中:
$(document).on('click touch', '.open', function(){
$(this).toggleClass('active');
});
$(document).on('click touch', '.modal, .modal-close', function(){
$('.open').removeClass('active');
});
$(document).on('click touch', '.modal-content', function(e){
e.stopPropagation();
});
并尝试将cursor:pointer
添加到open
元素:
.open{
cursor:pointer;
}
或者来自js代码:
$('.open').css('cursor','pointer');
希望这有帮助。