Introduction
I would like to start with a small history of why this Blink in web browser requirement came at all. I had a small requirement for a small regional client here, in freelance. They wanted blinking in certain parts of the page for information that is marked from the admin section of the site, basically to emphasize any new or impressive information.
Tags Availability
I know there is a BLINK
tag in Netscape, but again that does not work in MSIE, which has its own properitary MARQUEE
tag for scrolling. I searched the Internet and got some custom BLINKER
s, but then the blinkers made the page jump every time the DIV
was set to invisible. After a long search, I got this small code snippet which I refined a bit and which I would like to share with anyone who needs a similar code compatible across both MSIE and Netscape.
A few months back I had shared a bit of code which would accomplish this for Netscape and IE using proprietary JavaScript techniques. Recently I just thought I would enhance this using standard jQuery and minimal code.
Method
- A simple and standard DIV with a particular class can be used.
- With a simple JavaScript timer the visibility of the class is toggled.
How to Use
Currently the attached zip file has only one static blink.htm page. It utilizes jQuery from Google CDN. The code in the $(".blink")
function is the one which designates the DOM elements that need to be blinked.
Summary
The intent of this article is demonstrating the use of jQuery towards making a browser-independant code for even features that were conceived once upon a time as browser-specific features. The highlight is also towards using CDN URLs in lieu of local URLs so that performance and maintenance are significantly and greatly improved.