Thanks for your replies guys,

Worked like a charm :)

On Apr 15, 11:28 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Dennis,
>
> Yes, use the callback function.
>
> $(document).ready(function(){
>         $("#menu li").click(function(){
>                 $(this).fadeTo(1000, 0, function() {
>        $(this).html("changed").fadeTo(1000,1);
>      });
>         });
>
> });
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Apr 14, 2008, at 7:13 AM, Iminay wrote:
>
>
>
> > Hi,
>
> > I've been trying to change the content of an element using html(),
> > however I want to fade the element out before I change the contents.
>
> > sample code:
>
> >    $(document).ready(function(){
> >            $("#menu li").click(function(){
> >                    $(this).fadeTo(1000,0).html("changed").fadeTo(1000,1);
> >            });
> >    });
>
> > I have tried to implement a waiting period in between the fadeTo() and
> > the html(), using the pause plugin aswell as using
> > the .animate({opacity: 1.0}, 3000) method, however the contents of the
> > <li> always changes before the fade is completed.
>
> > Does anybody know how I could let the contents of the <li> fadeout,
> > then change it using html(), and then fading the new content in again?
>
> > Kind regards,
> > Dennis Bamber

Reply via email to