Response title
This is preview!




<script>$(document.body).click(function () {
$("div").show("slow");
$("div").animate({left:'+=200'},2000);
$("div").queue(function () {
$(this).addClass("newcolor");
$(this).dequeue();
});
$("div").animate({left:'-=200'},500);
$("div").queue(function () {
$(this).removeClass("newcolor");
$(this).dequeue();
});
$("div").slideUp();
});</script>
When using effects, one is done after the other.
But when changing classes,you have to issue the queue() function in order
to queue the "change class effect" after the effects have finished.
(am i wrong?)
so i have this :
function showResults() {
$("div#inner").fadeOut(200);
$("div#inner").removeClass();
$("div#outer").eq(resultNo.No1-1).children("div#inner").delay(0).fadeIn(500).addClass("result");
$("div#outer").eq(resultNo.No2-1).children("div#inner").delay(1000).fadeIn(500).addClass("result");
$("div#outer").eq(resultNo.No3-1).children("div#inner").delay(2000).fadeIn(500).addClass("match");
}
and i should put the second line in queue in order to remove the classes
AFTER the fade out has happened and not simultaneously.
so this is what i created :
function showResults() {
$("div#inner").fadeOut(200);$("div#inner").queue(function () {
$(this).removeClass();$(this).dequeue();});$("div#outer").eq(resultNo.No1-1).children("div#inner").delay(0).
fadeIn(500).addClass("result");
$("div#outer").eq(resultNo.No2-1).children("div#inner").delay(1000).fadeIn(500).addClass("result");
$("div#outer").eq(resultNo.No3-1).children("div#inner").delay(2000).fadeIn(500).addClass("match");
}
It is almost the same but it doesn't seem to work.
I also tried instead of $(this) the $("div#inner").
So i must have misunderstood something.
Can someone tell me what am i thinking wrong?
© 2012 jQuery Foundation
Sponsored by
and others.
