How to create blinking effect in JQuery?

Here we created a simple function "Blink". It required two parameters. One is the element object and other is the blinking speed. You will have to include jQuery library. In this example the blink() function is used for to blink the span element. jQuery animate() method is the main part of this function.

<script>
function Blink(Element,Speed)
{
    Element.animate({opacity: 0.2},Speed,function()
    {
    Element.animate({opacity: 1.0},Speed,function()
        {
        Blink(Element,Speed);
        });
});
}
$(document).ready(function()
{
Blink($(".Warning"),200); //400 = Blinking Speed
});
</script>
Final code and demo is here


Demo

Comments

Popular posts from this blog

Gove confirms mandatory housebuilding targets for councils will be abolished in face of Tory rebellion – UK politics live

Kotak Mahindra Bank Recruitment 2022 Released for Graduate Candidates And Apply Online