用一个div当做了一个按钮来使用。

<div class="button">
    <div class=" next_button button_left btn_red" style="width: 345px;">
    下一步
    </div>
</div>

因为是动态添加的内容,所以想要使用click事件,需要给他用on绑定一下:

$(document).on("click",".next_button",function(){
    alert();
});

这个时候,使用苹果手机访问的时候,发现了一个坑爹的问题,如论如何点击“下一步”,都没有任何反应,可是在安卓和各种模拟器中一切正常。后来经过查找资料才知道,苹果有这么个设置: 
对于点击的对象,拥有cursor:pointer这个样式的设置,也就是说,鼠标放上去,能够出现“手”型的图标才被认作可以使用点击事件,于是果断增加了样式

<style>
    .next_button{
        cursor:pointer
    }
</style>

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2021-07-26
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-11-16
相关资源
相似解决方案