这个是关于使用
$(document).on(‘click‘,selector,function)
在移动端ios中使用on点击事件无效的解决办法
1.将selector元素增加样式cursor:pointer(全场最佳解决方案)
<style>
.a{width:100px;height:100px;background:red}
.b{width:10px;height:10px;cursor:pointer}
</style>
<div class="a">
<div class="b">
</div>
</div>
<script>$(document).on(‘click‘,‘.b‘,function(){console.log(‘22222‘)})</script>
2.将click换成touchstart(在移动端基本都用吧)
$(document).on("touchstart",function(){console.log(‘22222‘)})
3.将document换成selector元素的父级元素
$(".a").on(‘click‘,".b",function(){console.log(‘22222‘)})