Jquery Fade Effect On Form Input Focus -


This question is similar to my previous hover question () but the answer will be different because it has a click function and two bgs.

I am creating a contact page, and when the user clicks on one of the input fields, I want to fade the background of input from one BG to another. You can see it here:

To add more clicks, I still have added this code to fade these codes but the texture does not work:

  & lt; Script type = "text / javascript" & gt; ('Focus', function (event, UI) {var target = jQuery ('input.name') {{function}); Target.animate ({'backgroundcolor': '# b1b1b1'}, 250, 'linear')});}) (); (Function () {jQuery ('input.name'). Tie ('Blurred', Function (Event, UI) {var target = jQuery ('input.name'); target.animate ({'BackgroundColor': '# CFD2D2 '}, 250,' linear ')});}) (); (Function () {jQuery ('input.email'). Tie ('Focus', Function (Event, UI) {var target = jQuery (' input.email '); target.animate ({' backgroundcolor ':' # B1b1b1 ('Blur', function (event, UI) {var target = jQuery} '' Input.email '); target.animate ({' backgroundColor ':' # CFD2D2 '}, 250,' linear ')}); }} (); (Function () {jQuery ('input.website'). ('Focus', function (Event, UI) {var target = jQuery (' input.website '); target.animate ({' backgroundColor ':' #B1b1b1 '}, 250,' linear '}}}} (); (function () {jQuery (' input.website '). Tie (' Blurred ', Function N (Event, UI) {var Target = jQuery ('input.website'); target.animate ({'background color': '# CFD2D2'}, 250, 'linear')});}) (); (functions () {jQuery ('input .area ') Bind ('Focus', Function (Event, UI) {var target = jQuery ('input.area'); target.animate ({'backgroundcolor': '# b1b1b1'}, 250, 'linear')}); (); (Functions () {jQuery ('input.area'). Bind ('Blur', Function (Event, UI) {var target = jQuery ('input.area'); target.animate ({'backgroundcolor ':' # CFD2D2 '}, 250,' linear ')});}) (); })}; & Lt; / Script & gt;  

How to do this correctly, and any ideas about Textera work?

a textorta and lieutenant; Textile & gt; element is, a & lt; Input & gt; Use 'textarea.area' instead of 'input.area' element.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -