ipad Web 应用程序:如何防止键盘在 jquery datepicker 上弹出 [英] ipad web application: How do I prevent the keyboard from popping up on jquery datepicker

查看:18
本文介绍了ipad Web 应用程序:如何防止键盘在 jquery datepicker 上弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有日期字段的表单,其中附加了一个 jquery 日期选择器.

I have a form with an date field with a jquery datepicker attached to it.

当我选择日期字段时,日期选择器会弹出,但 iPad 键盘会滑入视图并遮住日期选择器.

When I select the date field the datepicker pops up but then the iPad keyboard slides into view and obscures the datepicker.

在这种情况下如何防止键盘弹出?

How do I prevent the keyboard from popping up in this situation?

推荐答案

我使用了 Rob Osborne 解决方案的稍微修改版本,它成功地阻止了键盘在 iPad 和 iPhone 上弹出.

I used a slightly modified version of Rob Osborne's solution and it successfully prevented the keyboard from popping up on the iPad and iPhone.

$(".datePicker").datepicker({
    showOn: 'button',
    onClose: function(dateText, inst) 
    { 
        $(this).attr("disabled", false);
    },
    beforeShow: function(input, inst) 
    {
        $(this).attr("disabled", true);
    }
});

这篇关于ipad Web 应用程序:如何防止键盘在 jquery datepicker 上弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆