javascript - 选择日历图标时,表单字段变得不可见 - Google Chrome

标签 javascript html forms calendar visibility

我已经为这种形式苦苦挣扎了一段时间:http://www.thebeardmore.com/booking-mask/

我正在使用 Google Chrome 进行调试。

当我单击“日历”图标时,会出现日期框,覆盖下方的输入字段(夜间/成人/ child )。

但是,这也使得这些字段从此完全不可见(visibility:hidden)。

谁能解释为什么会发生这种情况以及我该如何阻止它?

谢谢。

最佳答案

脚本基本上隐藏了日历覆盖的任何元素(通过设置 visibility: hidden )。我认为这是因为 IE6 中的渲染问题。但是,它会导致问题 ChromeIE8 ,因此禁用此行为可能是值得的。

几种方法:

1) 设置visibility: visible内联:

<select id="nights" name="Length" style="visibility: visible">

2) (最好)覆盖日历的 hideShowCovered方法:

// At the top of your script
Calendar.prototype.hideShowCovered = function() {};

关于javascript - 选择日历图标时,表单字段变得不可见 - Google Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8113634/

相关文章:

javascript - 根据 div 的值隐藏表单域

javascript - 按 Enter 键不适用于 AngularJS

javascript - JS : Fetch string from array that matches line in form-input

javascript - 当值为零angularjs时从时间中删除分钟部分

html - 位置绝对底部 : Do not change flow of text

html -::after 中背景颜色的 CSS 问题

javascript - $_POST with javascript – 它在 javascript 中有效,但在 jquery 插件中无效

javascript - 将字符串中的 '+' 加号转义,以便在 coffeescript/javascript 的正则表达式中使用

javascript - 根据if结果改变let值

javascript - 添加 intArray 的内容