That could make it too :)

And your code should work... just as I said before, It seems that urs
callbacks are not working but it is 'cuse the latency of ur ajax request is
too low (which is good) so ur "loading" appear and dissappear  in a instant
if the loading of the images have already finished. If not then it doesn't
have the time to even loaded.

Hope that help

On Jan 8, 2008 1:56 PM, Hamish Campbell <[EMAIL PROTECTED]> wrote:

>
> To clarify what Cesar said, the loading function _has_ finished
> executing (ie, modifying the DOM). You need to preload any images
> first so they don't have download it when the function fires.
>
> eg: http://www.ilovejackdaniels.com/css/preloading-images-with-css/
>
>
> On Jan 9, 8:40am, "Cesar Iduarte" <[EMAIL PROTECTED]> wrote:
> > On Jan 8, 2008 12:38 PM, rics <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hello people,
> >
> > > How can I force some code to run only when the execution of other
> > > function finish? Look my code:
> >
> > > function loading() {
> > > $("#ajaxContent").slideToggle("normal", function() {
> > > $("#ajaxLoader").toggle();
> > > });
> > > }
> >
> > > $("#searchBar > button").click(function() {
> > > loading();
> > > $.get("ajax/list.php", function(data){
> > > $("#ajaxContent").html(data);
> > > loading();
> > > });
> > > });
> >
> > > In the second block of code I want the $.get to execute only when the
> > > function loading(), that was coded by me, finish to execute. I mean,
> > > when the #ajaxLoader is show up.
> >
> > > How can I do something like that?
> >
> > If I'm getting right... ur results display before ur "loading" image
> even
> > appear...
> > If that so... you could use a timer with a constant delay 'cuse u really
> > don't know how long it takes to the browsers shows ur "loading"
> display...
> >
> > --
> > Innovation the most beautiful Imagination's result- Hide quoted text -
> >
> > - Show quoted text -
>



-- 
Innovation the most beautiful Imagination's result

Reply via email to