首页 > 解决方案 > 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

rooney.soonlabs.com/contact.html

标签: htmlcss

解决方案


问题是函数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>

推荐阅读