A placeholder is a property that a text box uses to prompt the content, such as:"txt"type="text" name="account" placeholder="请输入帐号">will appear as:However IE9 does not support this attribute, you can use JS to simply simulate the placeholder behavior.My basic idea is to set the value for the input box and set the font color to simulate
HTML5 the new properties of the Chinese text box placeholder is a very useful attribute, but the IE series does not support this property until IE9, which makes us hesitant to use this attribute. I've written a lot of similar widgets, but they're not very generic, and here's a step-by-step enhanced custom placeholder jquery plugin. A bit is simple to use, you can also according to their own needs to improve
Placeholder, placeholder ......
Blog placeholder is something we want to do but cannot do. Today, I saw a sentence: "My life has no placeholder ." I am very domineering, but today I want to sing a reverse tone to fight for the placeholder.1 Introduction:
The master can be us
Original works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://xyly624.blog.51cto.com/842520/864959There are many ways to make the browser support placeholder, which are not perfect, more or less problematic, and some natively supported browsers will empty the place
This article details the placeholder attribute compatible with js. If you need it, you can refer to the programmer developed as a. net background. Most of the blogs are front-end blogs. Is it time to consider changing the direction and switch to the front-end for development...
I am confused about whether or not I should change jobs recently. I have a difficult choice!
Continue to the front-end. This time, let's talk about the
QQ Mail Login (http://mail.qq.com)as follows:In the above a demo similar principle made the next modification, produced a interactive effect of this demo, I hope that interested peers can help a little busy, you can click here: the change of transparency placeholder Interactive demoThe demo above must be viewed under a browser that does not support the placeholder property. Below from IE9 browser:Similarly,
1. We all know that uitextfield supports setting placeholder and can change the placeholder font size and color. Refer to the Code:
/* Set placeholder */[textfield setplaceholder: @ "Placeholder in textfield"];/* change the color of placeholder */[textfield setvalue: [uicol
When designing a website, the images to be used do not usually exist at the beginning. layout is the most important. However, the image size is usually pre-configured, and some practical placeholder images can help us better preview and analyze the layout.
Today, free automatic placeholder image generation tools are available, instead of manually creating these placehol
HTML5 supports placeholder native. For unsupported browsers (IE), it can be simulated using Js.JSCode
( Function (){ // Determine whether placeholder is supported Function Isplaceholer (){ VaR Input = Document. createelement ('input '); Return "Placeholder" In Input;} // Unsupported code If (! Isplaceholer ()){ // Create a class Functi
We all know that uitextfield has the placeholder attribute, and uitextview does not have placeholder. How can we simulate uitextfield to make uitextview have placeholder.
The idea is: Inherit the uitextview and make [Super text] display placeholder when the text is null.
The Code is as follows (I referenced arc ):
Uip
As a program developed by the. net background, most blogs are related to front-end blogs. Is it time to consider changing the direction and switch to the front-end for development...
I am confused about whether or not I should change jobs recently. I have a difficult choice!
Continue to the front-end. This time, let's talk about the placeholder attribute in the input box.
The new attribute of html5 is the prompt text (your own understanding) displayed
Today, when I was writing a page, when testing a low-version browser, I found that the placeholder displayed in input was blank, so I deliberately wrote a popular trial method to allow this property to be supported by a low-version browser.Bo Master built a technology sharing QQ group:164858883, because the number is still relatively small, active is not very high, I hope to have the same ideas, and I am interested in technology sharing technology hou
1.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 focus. To achieve this effect in the past is to use JavaScript control to achieve;2. Since placeholder
Long ago wrote this plug-in, based on jquery implementation, mainly used in IE to achieve placeholder effect, can support both text and password input box.
Placeholder is a new property in HTML5, when input sets the property, the content of the value is displayed as a gray hint in the text box, and the prompt text disappears when the text box gets the focus.
Download Address: Http://xiazai.jb51.net/201501
Patience and perseverance are painful things, but they can gradually bring you benefits. --OvidProperty placeholderSpring has always supported the definition of a property to a file of an external property and inserted it into a spring bean using a placeholder value.The placeholder is in the form of a property name that is wrapped with "${}", in order to use the property
Programme I:
Discard the original attribute placeholder, add a sibling span for input, and set absolute positioning for span (the parent node is position:relative;) so that it is above input. The HTML code fragment is as follows:
1 2 3 4 5 6 7 8 9 10 11-12
JS code is as follows (simple write a function, did not write plug-in form, hehe):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
You can use the placeholder control to place an empty container control in a Web page, and then dynamically add, delete, or traverse each child element at run time. The control renders only its child elements, and there is no HTML-based output itself.
You can add any HTML controls, even JavaScript code, to placeholder during the actual use.
Use the placeholder
Because some browsers do not support placeholder, a jquery plugin is written to simulate the placeholder effect.Method of Use: $ ("#IDName"). placeholder ();Words don't say much, directly on the code ~ ~ ~(function ($) {$.fn.placeholder=function (options) { vardefaults={ pColor: "#BEBEBE", pActive: "#999", pFont: "14px", activeborder: "#080", posl:8 ,zindex: "" }
Original address: http://blog.csdn.net/leeyehong_self/article/details/7939147
We sometimes need to customize the style of the Uitextfield object, and we can add many different rewriting methods to change the display behavior of the text field. These methods return a CGRECT structure, define the bounds of each part of the text field, and even modify the placeholder color, font.
–textrectforbounds://Rewrite to reset the text area
–drawtextinrect://Chan
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.