How do I animate a glowing effect on text?

前端 未结 6 1157
闹比i
闹比i 2021-01-31 10:48

I haven\'t really been able to find any good simple tutorials an animating a glow effect. How do I animate glowing on text?

6条回答
  •  名媛妹妹
    2021-01-31 10:48

    You can use .animate to cycle to a chosen colour to create a "highlight" effect which is presumably what "glowing" means.

    $(".confirm_selection").hover(function() {
        $(this).animate({
            color: "red"
        }, 2000);
    }, function() {
        $(this).animate({
            color: "black"
        }, 2000);
    });
    

    You can try it here.

    NOTE: Colour animation requires the use of either the colour animation plugin, or jQuery UI (which I assume you are already using as it has been included in your fiddle).

提交回复
热议问题