テキストを含む div をフェードアウトさせ、別の div をフェードインさせようとしています。その後、元のものが戻ってきて、それを繰り返すかループするので、2 つのメッセージが常に繰り返されます。これが私のコードです。
<div id="specialoffer">
<div id="specialoffertext">Reduced rates over the <br />
next few months</div>
<div id="specialoffertext2" style="display:none;">Contact us today to <br />
find out more</div></div>
var $body = $(document.body),
cycle;
(cycle = function() {
$('#specialoffertext')..delay(2000)fadeOut('slow');
$('#specialoffertext2').delay(3000).fadeIn('slow');
$('#specialoffertext2').delay(3500).fadeOut('slow');
$('#specialoffertext').delay(5000).fadeIn('slow', cycle);
})();
jsfiddleで遊んでいるとうまくいきましたが、アップロードするとすぐに動作しませんか??