In particular, input [text] And textarea, and there is also a function of dragging the size of the table textarea in the lower right corner of textarea, as shown in:
Input [text]:
Textarea:
Sometimes the yellow border affects the page effect, and the layout is directly affected after the
Most of them rely on scrollheight (not the standard of the consortium, introduced by IE), KeyUp events to complete. One of the more interesting is the "mirror element" (mirror Element), and settimeout polling implementation. The general idea of realization is as follows:
To place a single pre element in a position:absolute way outside of client view, and to set it up like the textarea style, we call this pre element "mirror", The 200ms polling is the
TextArea is a text box, Google, IE, opera default display of two lines of text, Firefox default display 3 lines of text, rows more than two lines is a scroll bar, you can set the number of rows set to force how many rows to display.
For example:
The results are shown below, followed by IE, Google, Opera and Firefox.
You set the number of rows to force the display as follows
The following are the results, followed by IE, Google, Opera and Firefox
Y
Due to the fact that compatibility is not considered, today we are experiencing this problem:HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>Documenttitle>Head>Body> textareaname=""ID=""cols= "+"rows= "Ten"readOnly=true>Sdfasdfadsfasdftextarea> Scriptsrc= "Jquery-1.9.1.js">Script> Scripttype= "Text/javascript"> $(function(){ $('textarea'). On ('Click',function(){ //$ (this). attr (' re
Jquery plug-in achieves automatic height of multi-line text boxes [textarea]
This article mainly introduces the jquery plug-in to implement the automatic height of multi-line text boxes [textarea]. For more information, see
Functions:
1. When textarea is changed, the height of a row is automatically increased.2/When textare
Before the company to do the project, there is such a demand, I write a comment box, you can increase the number of comments with the increment and automatically expand, at first I want to use textarea implementation, but later try to find textarea is not suitable, textarea height will not increase with the number of input lines increased , so I went online to se
Requirements:
JQuery1.4 and above.
Purpose:
You can modify the content of any input or textarea without refresh. After the modification, ajax is submitted to the server and saved. The submission method can be set to post or get.
// If you want to publish this article, please indicate the exit, no outgoing copyright notice, I do not like to see this kind of website. My work website does not indicate the person who is serving Seven {See7di # Gmail.com}
Textarea highly adaptive (effective for chrome + ie8 tests), chromeie8
Recently, we have a requirement that the width of textarea be kept unchanged, but the height is adaptive with the user input height. Because the browser version is incompatible, many methods can only play a role in one browser.
Below I wrote a small demo, which can be used normally in chrome and ie8, and has not been tested in other brow
jquery implements the TextArea text box with a translucent text hint effect:TextArea text boxes are generally used to edit large sections of text, such as the editor or simple message reply and other functions, some in the TextArea text box has the default prompt language, the following describes how to use jquery to implement this function.The code is as follows:DOCTYPE HTML>HTML>Head>MetaCharSet= "Utf-8">
Jquery plug-in implements automatic height of multi-line text boxes [textarea], jquerytextarea
Functions:
1. When textarea is changed, the height of a row is automatically increased.2/When textarea deletes a row, the high dependency of the row is automatically reduced: jquery. xxx. js requires similar functions, but it is inconvenient to import other files to the
This article describes how to implement the automatic height of the multi-line text box [textarea] using the jquery plug-in. If you need it, refer to the following implementation functions:
1. When textarea is changed, the height of a row is automatically increased.2/When textarea deletes a row, the high dependency of the row is automatically reduced: jquery. xx
Setting the TextArea text box cannot be dragged to change the size:By default, the TextArea text box can be resized using the mouse drag, and in some cases it may be necessary to suppress this feature.The code is as follows:DOCTYPE HTML>HTML>Head>MetaCharSet= "Utf-8">Metaname= "Author"content= "http://www.softwhy.com/" />title>Ant Tribetitle>styletype= "Text/css"
Today, we encountered this problem when submitting our form, so we can solve it with the legendary jquery.
Here we mainly talk about the focus issue in IE, because it is supported in Firefox
CopyCodeThe Code is as follows: input: Focus
Textarea: Focus
In ie: the focus is invalid. Therefore, we need to add a new style to the input and textarea after clicking to achieve the focus effect.Let's first look a
Reproduced from: http://www.jb51.net/article/61997.htm
TextArea highly adaptive code implemented in jquery. This animation has a smoother effect. Suitable for beginners to learn. Very simple and practical, it is recommended to small partners here.
I've shared it with JavaScript. Control text box textarea height with content adaptive growth contraction, today spent a bit of time to change the implementatio
Although I have never used the HTML control textarea, according to my own style, lou pig boldly believes that the textmode of the textarea and Server Control textbox is multiline and should be the same on the final HTML Tag. Maybe it's preemptible. In a design page last week, Lou pig wrote the following HTML without thinking.Code:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.C
1. Chrome users all know that when the focus of the mouse is on the input and textarea elements, chrome adds a yellow border to them by default, which is not a feature of chrome, it is the effect of CSS, the outline attribute.You can use the following CSSCodeRemove the borders of all elements:
*: Focus{Outline:None;}
Use the following code to remove the border of the element you want to remove:
1 . No
TextArea height adaptive should be very simple, just need to use JS to listen to its input and then modify its height, even for IE as long as the use of CSS (overflow:visible;) control can be. But there are also compatibility issues, implemented with jquery plugins. The code is as follows:$.fn.extend ({Textareaautoheight:function (options) {This._options = {minheight:0,maxheight:1000}This.init = function ()
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.