html - Hide textfield blinking cursor -
i have textfield there way hide blinking text cursor? because doing horror/mystery website , 1 of clues start typing anywhere.
maybe can javascript?
try this:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title >text area no carat</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <style type="text/css"> .textarea-wrapper { position:relative; } .textarea-wrapper textarea { background-color:white; } .textarea-wrapper, .textarea-wrapper textarea { width:500px; height:500px; } .textarea-wrapper textarea.hidden { color:white; opacity:0.00; filter:alpha(opacity=00); position:absolute; top:0px; left:0px; } </style> <script type="text/javascript"> $(document).ready( function() { $("textarea").addclass("-real-textarea"); $(".textarea-wrapper").append("<textarea class=\"hidden\"></textarea>"); $(".textarea-wrapper textarea.hidden").keyup( function() { $(".textarea-wrapper textarea.-real-textarea").val($(this).val()); } ); $(".textarea-wrapper textarea.-real-textarea").focus( function() { $(this).parent().find("textarea.hidden").focus(); } ); } ); </script> </head> <body> <div class="textarea-wrapper"> <textarea></textarea> </div> </body> </html>
the idea create second, invisible <textarea>
over/on-top-of real one. user typing in invisible 1 text doesn't appear (nor caret/cursor) invisible! use javascript assign value visible one.
but doesn't seem work in ie8 :'( caret still visible though opacity cranked 11.
but works in firefox... ?
Comments
Post a Comment