Text blinking jQuery

后端 未结 30 1904
我寻月下人不归
我寻月下人不归 2020-11-27 03:23

What is an easy way to make text blinking in jQuery and a way to stop it? Must work for IE, FF and Chrome. Thanks

30条回答
  •  旧巷少年郎
    2020-11-27 03:57

    I was going to post the steps-timed polyfill, but then I remembered that I really don’t want to ever see this effect, so…

    function blink(element, interval) {
        var visible = true;
    
        setInterval(function() {
            visible = !visible;
            element.style.visibility = visible ? "visible" : "hidden";
        }, interval || 1000);
    }
    

提交回复
热议问题