Objective
In iOS development, Uitextfield and Uitextview are the most commonly used text-acceptance classes and text-display controls. Uitextfield and Uitextview Both enter text and can also listen for changes to the text. The difference is that Uitextfield inherits from Uicontrol this abstract class. Uitextview inherits from Uiscrollview this entity class. This causes Uitextview to display content more than one line, and can also scroll like Uiscrollview. And Uitextfield can only display a sing
ArticleDirectory
Traditional Solution
Jqueyr placeholder text
Remove WebKit search box style
A very good extension function in HTML5 is to add placeholder text on the text box. Placeholder refers to the prompt text displayed when a text box is not focused. It is blank after being clicked. This function is good, but not all browsers support i
Placeholder is a useful property that prompts the user to enter the correct content in the input box, but the IE8 and IE8 browsers do not support this property, and we can use JS to simulate similar effects. Directly below the code:DOCTYPE HTML>HTML>Header>MetaCharSet= "Utf-8">title>Placeholdertitle>styletype= "Text/css">*{margin:0;padding:0;}form{margin:50px;}input{Display:Block;margin:0 0 6px 0;}style>Header>Body> form>User name:inputname= "Name"
Placeholder attribute, ie to its support expressed frustration, Firefox, Google Chrome said no pressure.HTML5 has made many enhancements to the Web Form, such as input type, Form validation, and so on. Placeholder is another property added by HTML5, and when input or textarea is set, the content of the value is displayed as a gray hint in the text box, and the hint text disappears when the text box gets the
placeholder Properties Placeholder (placeholder) in the actual application is very common, mainly used to prompt input content, modern browsers support: placeholder style this is a search online. Placeholder style related knowledge, share:/* all */:-webkit-input-
Compatible with placeholder and placeholder
As we all know, IE9 is not compatible with the placeholder attribute, so we have customized a jQuery plug-in, placeHolder. js. The code for placeHolder. js is as follows:
/*** This control is compatible with IE9 or lower, and is s
Placeholder font style and compatibility, placeholder Font Style
Style modification css:-Webkit-input-placeholder {/* WebKit browsers */color: # fff! Important ;}:-Moz-placeholder {/* Mozilla Firefox 4 to 18 */color: # fff! Important ;}:-Moz-placeholder {/* Mozilla Firefox 1
Firefox/chrome/opera has supported this feature from a version, but the IE series is not supported by IE9, so JavaScript is required to be compatible with browsers that do not support placeholder features.
Popular Practice
The common practice now is to change the value by using the Onfocus/onblur event of the form element, as follows:
Copy Code code as follows:
Most of jquery's Watermark Plug-ins (Http://archive.plugins.jquer
ArticleDirectory
Previously implemented using JavaScript
Use jquery to generate placeholders
Remove WebKit search box style
Reprinted please specify original address: http://www.cnblogs.com/softlover/archive/2012/11/20/2779878.html
HTML5 enhances a function for web form forms, which is the placeholder of input --Placeholder. The placeholder
HTML5 adds new properties to the input box, such as placehoLder (Placeholder), which indicates that some text is pre-placed in the text box. Placeholders are sample content that the text box can accept, and the general color is gray. As soon as one stone hits the text box, he disappears. If you delete all the entries you have entered, and then stand outside the text box, it will appear again. Try JavaScrip
Set the desired color for placeholder:-moz-placeholder{/* Mozilla Firefox 4 to 18 */Color #000;Opacity1;}::-moz-placeholder{/* Mozilla Firefox 19+ */Color #000;Opacity1;} input:-ms-input-placeholder{color: #000 ; opacity: 1; }input::-webkit-input-placeholdercolor: Span class= "Hljs-hexcolor" > #000; opacity: 1;
Solutions for implementing placeholder effect and placeholder
Placeholder is an attribute of html5
Solution 1:
Discard the original property placeholder, add a sibling node span for the input, and set absolute positioning for the span (the parent node is position: relative;) so that it is located above the input. The
We know that in iOS development, the control Uitextfield has a placeholder property, Uitextfield and Uitextview use the method basically similar, there are two small differences: 1. Uitextfield single-line input, while Uitextview can enter multiple lines. 2.UITextField has a placeholder attribute, and Uitextview does not. As for the two agent method, the principle is basically similar, but the method name s
TextField uses the placeholder property, but it also sets the Text property in the code, so Viewcontroller displays both placeholder and text text.This problem has made me completely collapsed. According to the truth, when the text length is 0 o'clock placeholder text display, text text length is not 0 o'clock placeholder
Here's a generic version of the same code:
struct stackelement> {
var items = [element] ()
mutating func push (_ Span class= "NV" >item: element) {
items. append (item)
}
mutating func pop () element {
return items.
}
}
Note how the generic version Stack of was essentially the same as the nongeneric version, but with a type parameter called Elementinstead of an actual type of Int . This type parameter are written wi
About Spring using the Context:property-placeholder property placeholder settings configuration fileThe beautiful Life of the Sun Vulcan (http://blog.csdn.net/opengl_es)This article follows "Attribution-non-commercial use-consistent" authoring public agreementReprint Please keep this sentence: Sun Vulcan's Beautiful Life-this blog focuses on Agile development and mobile and IoT device research: IOS, Android
We all know that when the mailbox landing when the default state will have a text reminder, when the mouse focus on the mailbox text box, the content text will be emptied.HTML5 has a placeholder (placeholder) attribute, but compatibility is not particularly good ~ Here's how jquery worksCSS code:jquery Code:$ (function () {$ ("#address"). focus (function () {//Address box gets mouse focusvar txt_value=$ (th
Step by step, gather small streams ------- js to implement the placeholder effect, placeholder. js
I asked a question in the "Technical Q A" a few days ago, and then I wrote a reply to summarize the effect of placeholder. I have to say that if I know more, I can make it concise, describe the clearest expressions in the simplest language.
However,
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.