Click here to Skip to main content
15,887,386 members
Articles / Programming Languages / Javascript
Tip/Trick

Cross-browser blink feature

Rate me:
Please Sign up or sign in to vote.
1.05/5 (16 votes)
20 Mar 2013CPOL2 min read 84.6K   705   12   12
The Blink Feature in Netscape browsers is really a cool one. Here we would bring in the Blink feature for Microsoft Internet Explorer using a simple JavaScript trick.
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 BLINKERs, 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

  1. A simple and standard DIV with a particular class can be used. 
  2. 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. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
Vasudevan Deepak Kumar is from Chennai, India who has been in the programming career since 1994, when he was 15 years old. He has his Bachelors of Engineering (in Computer Science and Engineering) from Vellore Engineering College. He also has a MBA in Systems from Alagappa University, Karaikudi, India.
He started his programming career with GWBasic and then in his college was involved in developing programs in Fortran, Cobol, C++. He has been developing in Microsoft technologies like ASP, SQLServer 2000.
His current focus is ASP.NET, C#, VB.NET, PHP, SQL Server and MySQL. In his past-time, he listens to polite Carnatic Music. But the big question is that with his current Todolist backlog, does he get some past time?

Comments and Discussions

 
GeneralChanges for this script to work on both FF and MS IE Pin
Gnana Swaroop19-Mar-08 0:51
Gnana Swaroop19-Mar-08 0:51 
Generalgood work Pin
paras12122-May-07 4:06
paras12122-May-07 4:06 
GeneralCorrection Pin
Florent Geffroy9-Dec-04 11:08
Florent Geffroy9-Dec-04 11:08 
GeneralOne word... Pin
netclectic6-Oct-03 22:26
netclectic6-Oct-03 22:26 
GeneralRe: One word... Pin
Vasudevan Deepak Kumar6-Oct-03 23:16
Vasudevan Deepak Kumar6-Oct-03 23:16 
GeneralRe: One word... Pin
Jörgen Sigvardsson7-Oct-03 2:23
Jörgen Sigvardsson7-Oct-03 2:23 
GeneralRe: One word... Pin
Michael Dunn12-Oct-03 8:14
sitebuilderMichael Dunn12-Oct-03 8:14 
GeneralRe: One word... Pin
Vasudevan Deepak Kumar12-Oct-03 17:32
Vasudevan Deepak Kumar12-Oct-03 17:32 
GeneralRe: One word... Pin
LeonJ12-Oct-03 23:34
LeonJ12-Oct-03 23:34 
GeneralRe: One word... Pin
Anonymous4-Jan-04 20:49
Anonymous4-Jan-04 20:49 
GeneralRe: One word... Pin
volkan.ozcelik28-Dec-05 11:47
volkan.ozcelik28-Dec-05 11:47 
AnswerRe: One word... [modified] Pin
manishknamdeo30-May-06 8:46
manishknamdeo30-May-06 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.