<label class="js_highlight" style="display: inline-block;float: left;width: 50%;">
<div class="compare-top-left-check">
<label class="label-check"><i style="display: none;"></i></label>
<span style="margin-left: 20px;"> Hide different items</span>
</div>
</label>

js:  以上代码在电脑浏览器和安卓上都能触发alert事件,但是在ios上却完全没有反应

$(document).on("click",".js_equal_hide",function(){
var n=~~$(".JS_numshow").html().split("/")[0];

修改js代码调试: 将两层的div都加上点击事件

$(".js_equal_hide .compare-top-left-check").click(function () {
var n=parseInt($(".JS_numshow").html().split("/")[0]);
if(n<2)return false;
var $this = $(this).parent();

  

苹果手机浏览器$(document).on(“click”,function(){})点击无效的问题的更多相关文章

  1. 苹果手机浏览器的$(document).on(“click”,function(){}) 绑定的事件点击无效

    需要给对应的元素加上 cursor: pointer  的css样式才可以生效点击事件:

  2. 【jQuery 区别】.click()和$(document).on("click","指定的元素",function(){});的区别

    给出以下的代码展示: //绑定 下一页 的点击事件 $("a[aria-label='Next']").click(function(){ $("a[aria-label ...

  3. jQuery的区别:$().click()和$(document).on('click','要选择的元素',function(){})的不同

    jQuery的出现,大大简化了对dom的操作,但是如果不是仔细阅读api和进行操作,就不知道其中最大的优点和使用方式.就拿$().click()和$(document).on('click','要选择 ...

  4. $(document).on('click','.classname',function(){}); VS $('.classname').on('click',function(){});

    jquery中用on来绑定事件,经常的写法有$(document).on('click','.classname',function(){});$('.classname').on('click',f ...

  5. $().click()和$(document).on('click','要选择的元素',function(){})的不同

    1. $(选择器).click(fn) 当选中的选择器被点击时触发回调函数fn.只针对与页面已存在的选择器; 2.$(document).on('click','要选择的元素',function(){ ...

  6. $().click()和$(document).on('click','要选择的元素',function(){})的不同(转https://www.cnblogs.com/sqh17/p/7746418.html)

    $(document).on();用于动态绑定事件 jQuery的出现,大大简化了对dom的操作,但是如果不是仔细阅读api和进行操作,就不知道其中最大的优点和使用方式.就拿$().click()和$ ...

  7. jquery bind event, use on. $(document).on("click","#a",function(){alert(1)}) [#document]

    $(document).on("click","#a",function(){alert(1)}) [#document] as a replacement o ...

  8. $().click()和$().on('click',function(){})的区别

    1. $(选择器).click(fn) 当选中的选择器被点击时触发回调函数fn.只针对与页面已存在的选择器. HTML代码: <!DOCTYPE html> <html lang=& ...

  9. hexo next中遇到的bug,引发出的关于jquery中click()函数和on("click",function())的区别

    个人博客:https://mmmmmm.me 源码:https://github.com/dataiyangu/dataiyangu.github.io 背景: 本人在维护博客的时候加入了aplaye ...

随机推荐

  1. jQuery : 有关TypeError: invalid ‘in’ operand obj的错误

    参考 lwx2615 的博客 ,网站:  http://blog.csdn.net/lwx2615/article/details/9668777 由PHP返回一个json数据 $.ajax({ ur ...

  2. 使用pyquery是遇到的一个403的问题

    在网上爬虫时,本地windows下运行pyquery代码正常,但是在linux下运行时一直报错 403 Forbidden.刚开始的代码如下 from pyquery import PyQuery a ...

  3. 字符串(string)与整型(int)、浮点型(float)等之间的转换

    #include <stdlib.h> 1.int/float to string/array: C语言提供了几个标准库函数,可以将任意类型(整型.长整型.浮点型等)的数字转换为字符串,下 ...

  4. 深入理解HashMap(原理,查找,扩容)

    面试的时候闻到了Hashmap的扩容机制,之前只看到了Hasmap的实现机制,补一下基础知识,讲的非常好 原文链接: http://www.iteye.com/topic/539465 Hashmap ...

  5. [CF1110E]Magic Stones

    题目大意:有一个长度为$n(n\leqslant10^5)$的数列$c$,问是否可以经过若干次变换变成数列$t$,一次变换为$c'_i=c_{i+1}+c_{i-1}-c_i$ 题解:思考一次变换的本 ...

  6. IntelliJ IDEA详细配置和使用教程-字体、编码和基本设置

    IDEA使用--字体.编码和基本设置 https://blog.csdn.net/frankcheng5143/article/details/50779149 IntelliJ IDEA详细配置和使 ...

  7. python对MySQL的CRUD

    我是闲的没事干,2014过的太浮夸了,博客也没写几篇,哎~~~ 用这篇来记录即将逝去的2014 python对各种数据库的各种操作满大街都是,不过,我还是喜欢我这种风格的,涉及到其它操作,不过重点还是 ...

  8. laravel 数据库迁移转 sql 语句

    可以使用下面的命令 php artisan migrate --pretend --no-ansi 当然,你需要有可以 migrate 的东西. 数据库迁移导出到文件(使用命令) <?php n ...

  9. R语言画图

    转http://www.cnblogs.com/jiangmiaomiao/p/6991632.html 0 引言 R支持4种图形类型: base graphics, grid graphics, l ...

  10. python学习(25) BeautifulSoup介绍和实战

    BeautifulSoup是python的html解析库,处理html非常方便 BeautifulSoup 安装 pip install beautifulsoup4 BeautifulSoup 配合 ...