JQueryFadeSwap(oldStuff, newStuff){
$(newStuff).hide(); // this handles browser differences, but also gives
you a place to hook it 'out' animations for new
$(oldStuff).fadeOut(function(){ // you can add a callback to animations
that run when the effect is completed
swap(oldStuff, newStuff); // your function (runs after old has faded
$(newStuff).fadeIn(); // new appears after old is removed and old/new
have been swapped
});
}
Blair
On 1/18/07, James Thomas <[EMAIL PROTECTED]> wrote:
You could use the setTimeout method, giving it enough time to make sure
that
the swap finished successfully.
rplobue wrote:
>
> Im looking for help on how to write a function. In standard javascript
i
> have 2 elements: oldData, and newData. Currently i just am swapping the
> two with replaceChild. However i want to add a [fade-out, replace,
> fade-in] sequence to it with JQuery.
>
> I am wondering is it possible to create a function like this in JQuery
and
> simply call it from a standard javascript function:
>
> JQueryFadeSwap(oldStuff, newStuff){
>
> newStuff.opacity = 0;
> oldStuff.fadeOut();
> swap(oldStuff, newStuff);
> newStuff.fadeIn();
> }
>
> Can someone give me some input on how to accomplish this? Thanks!
>
>
--
View this message in context:
http://www.nabble.com/newb-question---JQuery-fade-and-replace-tf3030628.html#a8420990
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/