0

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

what I am trying to do is: make the image inside that input do a fadeOut:

jsfiddle: http://jsfiddle.net/930yrzqa

  • 1
    Read up on `setTimeout` – j08691 Mar 09 '17 at 19:33
  • 1
    like that? : function bkgFadeOut(){ $("input").css('background-image').fadeOut(); } setTimeout(function(){bkgFadeOut();}, 2000); getting this error: Uncaught TypeError: $(...).css(...).fadeOut is not a function –  Mar 09 '17 at 19:37

1 Answers1

0

You are attemt to run fadeout function on css variable - this is not posible. This function is only for elements like div or img.

I guest, that you want to show the check icon on input and then hide it. The best way to do this is to add this image not as background but just as image then execute fadeOut on that img.

Here you can find an example: Put icon inside input element in a form

example of timeout:

function explode(){
  alert("Boom!");
}
setTimeout(explode, 2000);
Community
  • 1
  • 1
JOST
  • 51
  • 6