Javascript onclick事件不发生';我不能在iphone上工作
我有表格,应该上传图像。放置在iframe中的每个表单Javascript onclick事件不发生';我不能在iphone上工作,javascript,html,ios,css,iphone,Javascript,Html,Ios,Css,Iphone,我有表格,应该上传图像。放置在iframe中的每个表单 <body style="margin: 0; padding: 0; height: 100%; cursor: pointer;" onclick="document.querySelector('.register-upload-input').click()"> <form method="POST" action="http://127.0.0.1:8000/de/client/registerupload
<body style="margin: 0; padding: 0; height: 100%; cursor: pointer;" onclick="document.querySelector('.register-upload-input').click()">
<form method="POST" action="http://127.0.0.1:8000/de/client/registerupload" accept-charset="UTF-8" enctype="multipart/form-data">
<input class="register-upload-input" style="display: none;" onchange="document.querySelector(".preloader").style.display="block";document.querySelector("form").submit();" accept=".jpg,.jpeg,.png" name="image" type="file">
</form>
</body
将以下CSS添加到IFrame内容中
html, body {
touch-action: auto;
}
不要在
上设置显示:无,您可以改为设置高度:0px
编辑:
我检查了我的笔记,发现在stackoverflow上也有同样的问题
同样的问题也是如此
造成此问题的原因有三个:
在javascript中,删除returnfalse;事件侦听器
在样式表中,调用操作的元素必须具有
游标:指针;。也许苹果在这些电话中提出了这一要求
为用户界面提供最佳反馈
同样在样式表上,我们不能
设置显示:无;用于隐藏输入,因为某些浏览器没有
接受对未显示元素的单击
谢谢你的回复,我添加了这种风格,但仍然不起作用