0

I would like my background-image Property fadeOut after 3 seconds possible?

i could just make dissapear but not fadeOut

$("input").css('background-image', 'none');

1 Answers1

-1

Use css transition instead:

input {
  -webkit-transition: background 0.2s ease-in-out;
  transition: background 0.2s ease-in-out;
}
Đào Minh Hạt
  • 2,742
  • 16
  • 20
  • 2
    That doesn't immediately appear to work. Perhaps you could add an example with Stack Snippets (the `[<>]` toolbar button) to show exactly what you mean. – T.J. Crowder Mar 09 '17 at 17:25
  • 2
    And apparently, [it isn't supposed to work](https://www.w3.org/TR/css3-transitions/#animatable-properties). Neither `background` nor `background-image` isn't an animatable property. You could do this with `background-color`, but not an image. – T.J. Crowder Mar 09 '17 at 17:35
  • what I am trying to do is make the image in the input do a fadeOut: http://jsfiddle.net/930yrzqa/ –  Mar 09 '17 at 19:27