Code Snippets

  

JavaScript Source Code


Welcome to Dream.In.Code
Getting Help is Easy!

Join 131,939 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,890 people online right now. Registration is fast and FREE... Join Now!





Blinking text

Simple script to make your text blink

Submitted By: BetaWar
Actions:
Rating:
Views: 325

Language: JavaScript

Last Modified: October 9, 2008
Instructions: Simple change the ID of the DIV you want to have blinky and then put whatever text you want in it.

Snippet


  1. <script>
  2. function blink(elId){
  3.   var html = '';
  4.   if(document.all){
  5.     html += 'var bl = document.all.' + elId + ';';
  6.   }
  7.   else if(document.getElementById){
  8.     html += 'var bl = document.getElementById("' + elId + '");';
  9.   }
  10.   html += 'bl.style.visibility = ' + 'bl.style.visibility == "hidden" ? "visible" : "hidden"';
  11.   if(document.all || document.getElementById){
  12.     setInterval(html, 100);
  13.   }
  14. }
  15. function init(){
  16.   blink('Text');
  17. }
  18. onload=init;
  19. </script>
  20.  
  21. <div id="Text">
  22.   <blink>
  23.     Hello blinky!
  24.   </blink>
  25. </div>

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month