苹果手机浏览器$(document).on(“click”,function(){})点击无效的问题
<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(){})点击无效的问题的更多相关文章
- 苹果手机浏览器的$(document).on(“click”,function(){}) 绑定的事件点击无效
需要给对应的元素加上 cursor: pointer 的css样式才可以生效点击事件:
- 【jQuery 区别】.click()和$(document).on("click","指定的元素",function(){});的区别
给出以下的代码展示: //绑定 下一页 的点击事件 $("a[aria-label='Next']").click(function(){ $("a[aria-label ...
- jQuery的区别:$().click()和$(document).on('click','要选择的元素',function(){})的不同
jQuery的出现,大大简化了对dom的操作,但是如果不是仔细阅读api和进行操作,就不知道其中最大的优点和使用方式.就拿$().click()和$(document).on('click','要选择 ...
- $(document).on('click','.classname',function(){}); VS $('.classname').on('click',function(){});
jquery中用on来绑定事件,经常的写法有$(document).on('click','.classname',function(){});$('.classname').on('click',f ...
- $().click()和$(document).on('click','要选择的元素',function(){})的不同
1. $(选择器).click(fn) 当选中的选择器被点击时触发回调函数fn.只针对与页面已存在的选择器; 2.$(document).on('click','要选择的元素',function(){ ...
- $().click()和$(document).on('click','要选择的元素',function(){})的不同(转https://www.cnblogs.com/sqh17/p/7746418.html)
$(document).on();用于动态绑定事件 jQuery的出现,大大简化了对dom的操作,但是如果不是仔细阅读api和进行操作,就不知道其中最大的优点和使用方式.就拿$().click()和$ ...
- 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 ...
- $().click()和$().on('click',function(){})的区别
1. $(选择器).click(fn) 当选中的选择器被点击时触发回调函数fn.只针对与页面已存在的选择器. HTML代码: <!DOCTYPE html> <html lang=& ...
- hexo next中遇到的bug,引发出的关于jquery中click()函数和on("click",function())的区别
个人博客:https://mmmmmm.me 源码:https://github.com/dataiyangu/dataiyangu.github.io 背景: 本人在维护博客的时候加入了aplaye ...
随机推荐
- Centos/Fedora下安装Twisted,failed with error code 1 in /tmp/pip-build-H1bj8E/twisted/解决方法
Python踩坑之路 pip/easy_install无法安装Twisted或者安装后无法导入Twisted 看到MM网站上很多图,想用Scrapy框架爬点图,遇到各种库的问题,蛋疼. 一直twist ...
- Qt托盘程序
使用QSystemTrayIcon类可以实现托盘程序.在这里使用QMainWindow做实例: mainwindow.h头文件 #ifndef MAINWINDOW_H #define MAINWIN ...
- MT【158】只在此山中,云深不知处
求证:方程$3ax^2+2bx-(a+b)=0(b\ne0)$在$(0,1)$内至少有一个实数根. 提示:$f(0)=-(a+b),f(\dfrac{2}{3})=\dfrac{1}{3}(a+b)$ ...
- Go 示例测试实现原理剖析
简介 示例测试相对于单元测试和性能测试来说,其实现机制比较简单.它没有复杂的数据结构,也不需要额外的流程控制,其核心工作原理在于收集测试过程中的打印日志,然后与期望字符串做比较,最后得出是否一致的报告 ...
- Integer to Roman - LeetCode
目录 题目链接 注意点 解法 小结 题目链接 Integer to Roman - LeetCode 注意点 考虑输入为0的情况 解法 解法一:从大到小考虑1000,900,500,400,100,9 ...
- All flavors must now belong to a named flavor dimension
FAQ: All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/ ...
- 解题:NOI 2007 社交网络
题面 先跑一边Floyd乘法原理统计任意两点间最短路数目,然后再枚举一次按照题意即可求出答案,会写那道JSOI2007就会这个 #include<cstdio> #include<c ...
- shell 循环语句
1.while 2.for 3.until 4.select while #!/bin/bash # 显示一系列数字 count=1 while [ $count -le 6 ]; do echo $ ...
- python中的常用模块(2)
在自动化测试中,经常需要查找操作文件,比如说查找配置文件(从而读取配置文件的信息),查找测试报告(从而发送测试报告邮件), 经常要对大量文件和大量路径进行操作,这就依赖于os模块. 1.当前路径及路径 ...
- Python之路,Day2 - Python基础,列表,循环
1.列表练习name0 = 'wuchao'name1 = 'jinxin'name2 = 'xiaohu'name3 = 'sanpang'name4 = 'ligang' names = &quo ...