2

場合によっては時間を設定する必要がないものを使用し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);
});

これどうやってするの ?

4

1 に答える 1

1

このプラグインにはそのようなオプションはありません。これは、作成者がそれを作成するオプションを提供していないことを意味しdisableますが、単純なプロパティによって自分で作成できcssます。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" />

于 2018-03-12T11:13:26.010 に答える