Search code examples
javascriptcssdom-eventsfade

Fade div out when script activates


I am trying to fade out the media logos as soon as a JavaScript code activates.

http://rayku.com/start

When a user starts typing in the text box, a form comes up. At that moment, I'd like to have the media icons fade out.

Do you know how I can make that edit in the code?

Thanks!


Solution

  • Since the logos are a background image of the form you won't be able to fade them out, but you can just set the background-image rule to "none".

    Create a new css-class with the following content:

    .theNewClass {background-image:none;}
    

    Whenever a user enters something in the searchbox and the register form comes up, you add "theNewClass" to your register-form. When the register-form is dismissed you remove "theNewClass" from your register-form again and the logos will reappear.