Posted in: Jquery

How to Jquery Blink Text | Blink Text using Jquery | Text Blinking

Blink your Text with Jquery. This easy to use plugin for Jquery Blink Text is used in blinking the text over the website and it will support the IE, Chrome and other major browser.

In this example i am using a span which we will blink

<span class="blink">This text will blink</span>

Now we will add our Jquery code to run this blink script

<script type="text/javascript" src="js/blink.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('.blink').blink();
        })
    </script>

Here is the Jquery code which we are using in this blink.js

(function($)
{
	$.fn.blink = function(options)
	{
		var defaults = { delay:500 };
		var options = $.extend(defaults, options);

		return this.each(function()
		{
			var obj = $(this);
			setInterval(function()
			{
				if($(obj).css("visibility") == "visible")
				{
					$(obj).css('visibility','hidden');
				}
				else
				{
					$(obj).css('visibility','visible');
				}
			}, options.delay);
		});
	}
}(jQuery))

 Download the blink.js file

You can adjust the timing of blink by changing the delay option. So we complete the Jquery Blink Text tutorial

Thank you

Happy Coding.

How to Jquery Blink Text | Blink Text using Jquery | Text Blinking

Leave a Reply

Your email address will not be published. Required fields are marked *