html - Why mouse not working with this form (html)
问题描述
why mouse not working with form in this link
The mouse does not work when you press any of the input boxes in the Form
When you press any input box it does not activate the field
You must use the keyboard and press the tab button to access the field
解决方案
问题是函数mobiletouch()。删除功能和表单工作
您可以在运行前检查是否是移动的:
就像是:
function isMobile() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
return true;
}
else {
return false;
}
}
function mobiletouch() {
var mobile = isMobile();
if(mobile){
$('body').swipe({
swipe: function (event, direction){
if (direction == 'up'){
$('.next').trigger('click');
}else if(direction == 'down'){
$('.previous').trigger('click');
}
}
});
}
}
添加样式以更改表单字体颜色:
<style>
.contact-form textarea, .form-inp { color: #FFF }
</style>
推荐阅读
- shell - 如何从管道访问环境变量并将其传递给发布管道
- python - 未找到 Pyscopg2 模块
- java - 无法使用具有不同 Spring Boot 版本的库
- python - 做一个 except 继续迭代
- maven - JMeter 与 Jenkins。Maven vs 命令行执行
- javascript - 在 Html.BeginForm 的 onsubmit 参数中使用 return 的目的是什么?
- c# - Windows 无线网络报告是否有编程接口?
- javascript - 为什么我的 create-react-app 命令会产生 web pack 错误?
- gradle - Intellij IDEA 停止提示我导入更改
- javascript - 将 id 与 javascipt 进行比较