0

いくつかのオプションを試した後、テキストをフェードインおよびフェードアウトさせることができませんでした。何を試しても、このようなものを追加しても、アニメーション全体がフリーズします

$("#headertxt".fadeIn('slow').css({"display" : "block"});

また

$("#headerimg" + currentContainer).fadeOut(function() {
setTimeout(function() {
$("#headertxt".fadeIn({"display" : "block"}); 
animating = false;
}, 500);
});

$("#headerimg" + currentContainer).fadeOut(function() {
setTimeout(function() {
$("#headertxt".fadeOut({"display" : "block"}); 
animating = false;
}, 5000);
});

オリジナルのデモです

そして、ここにjfiddleがあります

4

2 に答える 2

0

およびfadeInとfadeOutはオブジェクトを引数として受け取らないので、なぜそれらがあるのか​​わかりません。また、前に括弧がありません.fadeIn

次のようなものを試してください。

$("#headerimg" + currentContainer).fadeOut(function() {
    setTimeout(function() {
        $("#headertxt").fadeIn(); 
        animating = false;
    }, 500);
});
于 2013-01-16T21:59:12.130 に答える
0

変化する

$("#headertxt".fadeIn('slow').css({"display" : "block"}); //this will not work

$("#headertxt").fadeIn('slow', function(){
  $(this).css('display', 'block');
});
// apply css after animation.
于 2013-01-16T22:00:09.740 に答える