【问题标题】:jQuery clockInput: Disable Clock Time PickerjQuery clockInput:禁用时钟时间选择器
【发布时间】:2018-03-12 11:03:29
【问题描述】:

我正在使用jQuery clockInput: Clock Time Picker 我想要的,在某些情况下我不需要设置时间,所以在这种情况下我想禁用时间选择并默认设置我设置的时间。

这是我使用的链接https://www.jqueryscript.net/time-clock/Clock-Time-Input-Plugin-jQuery-clockInput.html

一个简单的时钟代码:

$(document).ready(function() {
   $("input[type=time]").clockInput(false);
});

我该怎么做?

【问题讨论】:

    标签: javascript jquery datetimepicker jquerydatetimepicker


    【解决方案1】:

    这个plugin没有这个选项,这意味着作者没有提供一个选项来制作它disable但是你可以通过一个简单的@987654323自己做@ 财产。只需设置data-disabled="disabled" 属性即可。

    $(document).ready(function() {
      $("input[type=time]").clockInput(false);
    });
    input[data-disabled="disabled"]+.jq-ci {
      pointer-events: none;
    }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://www.jqueryscript.net/demo/Clock-Time-Input-Plugin-jQuery-clockInput/jquery.clockinput.js"></script>
    <link href="https://www.jqueryscript.net/demo/Clock-Time-Input-Plugin-jQuery-clockInput/jquery.clockinput.css" rel="stylesheet" />
    <input type="time" data-disabled="disabled" value="14:30:00" />

    【讨论】:

    • 谢谢它的工作。!!有没有办法通过数据库默认设置时间?
    • @Javed 很高兴为您提供帮助。是的,您可以通过value="14:30:00"默认设置值
    • gt css 有什么变化吗?
    • @Javed 设置默认时间?不,它与css无关。
    猜你喜欢
    • 1970-01-01
    • 2015-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-21
    相关资源
    最近更新 更多