Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
HTMLにテキストエリアがあります。ユーザーがタップすると、キーボードが適切にポップアップします。キーボードの閉じるボタンを押した後、画面の他の場所をタップすると、キーボードが表示され続けます。入力タップでのみキーボードを表示する方法はありますか?
次の jquery コードは、このトリックを実行します。
$(window).bind('touchstart', function (e) { if (!$(e.target).is(':input')) { $(':input').blur(); } });
基本的に、私はすべてのタップをキャッチします。ターゲットが入力フィールドでない場合は、すべての入力フィールドをぼかします。これにより、愚かなキーボードが事実上非表示になります。