What is the facebook status input element?
The facebook status update area seems look like an original input /开发者_开发知识库 textarea, when I use the div to inspect it, it shows a div only... What happen? How does it actually like? At how facebook implement the @somebody on the status input box??
It's just a jquery effect... in fact, there are two elements, a textarea element and a div element when you click on. the div is hidden and the textarea is shown... and when you click out, the div is shown and the textarea is hidden.
this is the jquery code to show and hide an elements:
$("#mydiv").click(function{ $("#mytextarea").show(); $("#mydiv").hide(); });
$("#mytextarea").mouseout(function{ $("#mytextarea").hide(); $("#mydiv").show(); });
you can see the jquery website for more jquery technics (you can download it if you've never used before)
精彩评论