質問するログイン新規登録

回答編集履歴

1

調整

2019/07/04 06:46

投稿

yambejp
yambejp

スコア118037

answer CHANGED
@@ -14,4 +14,29 @@
14
14
  <label>カレンダー</label>
15
15
  <input type="text" id="datepicker" name="tel">
16
16
  </div>
17
+ ```
18
+ # 追記css適用
19
+ テキストボックスにクラスを与えて幅が変更できない・・・的な話ですが
20
+ 普通に変更されますね。どこがどうなるかさっぱりわかりません。
21
+ ブラウザ依存の話かもしれないのでOSやブラウザの種類とバージョンを補足してほしいです。
22
+
23
+ ```javascript
24
+ <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
25
+ <style>
26
+ .hoge{width:300px}
27
+ </style>
28
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
29
+ <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
30
+ <script>
31
+ $(function(){
32
+ $("#datepicker").datepicker();
33
+ $("#datepicker").datepicker("option", "showOn", 'button');
34
+ $("#datepicker").datepicker("option", "buttonImageOnly", true);
35
+ $("#datepicker").datepicker("option", "buttonImage", 'ico_calendar.png');
36
+ });
37
+ </script>
38
+ <div>
39
+ <label>カレンダー</label>
40
+ <input type="text" id="datepicker" name="tel" class="hoge">
41
+ </div>
17
42
  ```