私は選択入力のように見えるものを作りたいと思っていますが、実際にはそうではありません。入力テキストに点滅するカーソルを隠す方法は?
<input type="text">
を作成しました。
私はbackground-image
を追加しました。これは「選択矢印」を表示し、選択ボックスであるという印象を与えます。
この入力にデフォルト値を追加しました。
私はそれをクリックするとこの入力の下にSlideDown()
となる隠れたdivがあります。
値を変更できないように読み込み専用のものを試しましたが、点滅するカーソルが表示されます。
私はdisabled
を使用する場合は、点滅カーソルが表示されませんが、jQueryので.click()
または.focus
機能が動作しません。ドロップダウンメニューはSlideDown()
になりません。
点滅するカーソルを表示しないでクリックするにはどうすればよいですか?
は、ここでは、コード
<div style="padding-top:17px; overflow:hidden;">
<div style="float:left;">
<label for="secretquestion">Secret Question</label><br>
<input type="text" class="inputselect" id="secretquestion" name="secretquestion" value="Choose a Secret Question" tabindex=10 /><br>
<div class="selectoptions" id="secretquestionoptions">
<b>test</b>
</div>
</div>
</div>
CSS
.selectoptions
{
display: none;
background-color: white;
color: rgb(46,97,158);
width: 250px;
margin:auto;
border-style: solid;
border-width:1px;
border-color: rgb(46,97,158);
font-size: 14px;
text-align: center;
}
.inputselect {
color: white;
cursor: pointer;
background-image: url('inputselect.png');
padding-top: 5px;
padding-bottom: 5px;
padding-left:10px;
padding-right:-10px;
width:240px;
border-style: solid;
border-color: rgb(46,97,158);
border-width: 1px;
}
.inputselect:hover {
outline:none;
color:aqua;
cursor: pointer;
background-image: url('inputselecthover.png');
}
.inputselect:focus {
outline:none;
color:aqua;
cursor: pointer;
background-image: url('inputselecthover.png');
}
試したコードを投稿できますか? – sinemetu1
[可能な解決策](http://stackoverflow.com/questions/3671141/hide-textfield-blinking-cursor) もう1つの解決策は、実際の入力の代わりに入力のように見えるようにスタイル指定されたdivを使用することです。 – approxiblue
@JimmyXはい私はそれについて考えましたが、この入力(選択)はフォームにあり、入力フィールドはお互いのように見えますが、ルールを破ったような気がしませんし、 P – user1213707