0

How do I fade in some text while a function is called and fade out when the function is done.

I have this:

$(".element").click(function() {
        loadStuff($(this).text());

     });

say i have another class element2 and i want it to display "Loading" while loadstuff is running and get out once its done..what's the simplest way to modify this code?

algorithmicCoder
  • 6,595
  • 20
  • 68
  • 117

2 Answers2

0

Here its something like that http://jsfiddle.net/damian_silvera/24BjA/

Damian SIlvera
  • 866
  • 1
  • 9
  • 19
0

you can use anonymous callback in jquery ,look into this question
Call a function after previous function is complete

Community
  • 1
  • 1
Buzz
  • 6,030
  • 4
  • 33
  • 47