I have a webpage that is animated using a jQuery fadeIn / fadeOut with divs. Each part of the webpage is loaded by the fade In effect, and the site never navigates to a new webpage. I am looking for a loading image to display each time while the fadeIn / fadeOut is in effect. How can I program this?
Asked
Active
Viewed 2,677 times
-3
-
3[What have you tried?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – PeeHaa Apr 17 '12 at 08:16
-
Tons of soloutions, [like this](http://blog.oio.de/2010/11/08/how-to-create-a-loading-animation-spinner-using-jquery/) ... You should just show before running the ajax request, and hide it on succes/error. – Marco Johannesen Apr 17 '12 at 08:18
-
I disagree with the vote down and closing of this question. Where can I dispute my points? – Kevin Apr 17 '12 at 16:52
1 Answers
3
I have always used this link to generate loading images...
Then the quickest thing to do is show and hide a DIV with that loading image in, or in jQuery add and remove a class to a DIV.
In CSS that class can apply the image as a background image to the DIV and centralise it.
$('#yourDiv').fadeOut('slow', function()
{
// Code to hide or show loading image
});`

Charles Menguy
- 40,830
- 17
- 95
- 117

SCMedia
- 71
- 2