Jquery - Animate innerHTML possible?

后端 未结 3 1055
暖寄归人
暖寄归人 2021-01-21 23:56

I\'m trying to have a function that does setTimeout, then changes the innerHTML:



        
3条回答
  •  日久生厌
    2021-01-22 00:46

    Try something like this:

    $(document).ready(function () { var interval = setInterval(function () { $('#text').append('

    new text

    '); $('#text p:last').fadeIn('slow'); }, 5000); });

    See the example here

    If you want to kill the interval, can be doing this:

    clearInterval(interval);
    

    Greatings.

提交回复
热议问题