Reputation: 3279
I'm developing an ASP.NET (VS2012, .NET 4) web app, and I'm going to create some effects for my text box like this site:
http://behnoush.iitco.ir/site/fa/Poll.html
as you can see, when user clicks on text boxes, their text is faded to a lighter color, also there is a picture in the textbox, I have found this site: http://fuelyourcoding.com/scripts/infield/ which is a jquery for simulating color fade effect, but in fact it uses labels, is there any way I can perform these nice effects with jquery and TEXTBOX? I've tested some methods for changing textbox text color when it receives focus, but there was no luck! also how can I display similar icons in my textboxes?
thanks
Upvotes: 0
Views: 601
Reputation: 749
This will do what you want for webkit browsers. just adjust color as desired.
::-webkit-input-placeholder { color: #808080; }
:focus::-webkit-input-placeholder { color: #d0d0d0; transition: all 1s ease-in-out; }
Upvotes: 1