Chat LIVE With Programming Experts! There Are 23 Online Right Now...

 

Code Snippets

  

JavaScript Source Code


Welcome to Dream.In.Code
Become an Expert!

Join 244,284 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 993 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: 1,928

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!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month