[jQuery] Re: simple jQuery img src Question

2009-02-02 Thread Ricardo Tomasi
Small correction: it should be bind('readystatechange'.. as jQuery adds the 'on' prefix by itself. cheers, - ricardo On Jan 22, 3:25 am, LoicDuros wrote: > Thanks everyone for your help. many different ways of doing it... I'll > try each of them until something works! THanks! > > On Jan 21, 11:

[jQuery] Re: simple jQuery img src Question

2009-01-21 Thread LoicDuros
Thanks everyone for your help. many different ways of doing it... I'll try each of them until something works! THanks! On Jan 21, 11:35 pm, Ricardo Tomasi wrote: > A cross-browser way of doing that: > > $('img').fadeOut(500, function(){ >   $(this).attr('src',newsrc).bind('onreadystatechange loa

[jQuery] Re: simple jQuery img src Question

2009-01-21 Thread Ricardo Tomasi
A cross-browser way of doing that: $('img').fadeOut(500, function(){ $(this).attr('src',newsrc).bind('onreadystatechange load', function() { if (this.complete) $(this).fadeIn(1000); }); }); http://jsbin.com/uriku http://jsbin.com/uriku/edit On Jan 21, 7:30 pm, Balazs Endresz wrote: >

[jQuery] Re: simple jQuery img src Question

2009-01-21 Thread Balazs Endresz
Also, see this discussion about using the load event with images: http://groups.google.com/group/jquery-dev/browse_thread/thread/24b107e84adeaaee On Jan 21, 8:55 pm, Bohdan Ganicky wrote: > Fixed braces: > > $('#image').fadeOut(500, function() { >   $(this).attr('src','images/'+newImg).load(func

[jQuery] Re: simple jQuery img src Question

2009-01-21 Thread Bohdan Ganicky
Fixed braces: $('#image').fadeOut(500, function() { $(this).attr('src','images/'+newImg).load(function() { $(this).fadeIn(1000); }); }); -- Bohdan On Jan 21, 8:54 pm, Bohdan Ganicky wrote: > In theory it would be something like this: > > $('#image').fadeOut(500, function() { >   $(this

[jQuery] Re: simple jQuery img src Question

2009-01-21 Thread Bohdan Ganicky
In theory it would be something like this: $('#image').fadeOut(500, function() { $(this).attr('src','images/'+newImg).load(function() { $(this).fadeIn(1000); }); } ...but I'm not at all sure if the "load()" captures the "src" attribute change like that. -- Bohdan On Jan 21, 7:54 pm, Lo