Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to have fade out effect in Javascript

I am doing an Ajax call and on response I would like to hide a div. Right now, I am able to do it successfully, but that is kind of quick. I want some fade out effect on it. How to do it in one single shot?

Here is my current code.

var someDiv = document.getElementById(someId);
someDiv.style.display="none";

Thank you very much in advance!

like image 683
bragboy Avatar asked Jan 19 '26 08:01

bragboy


1 Answers

Nice to see all five answers so far refer to jQuery.

There are several articles for creating a fade effect using vanilla Javascript, though be weary of the Javascript most people publish online.

like image 60
strager Avatar answered Jan 20 '26 21:01

strager