Techblog Technical Blog about all things computer
  • How to make a text Blink in Javascript.

    Filed under Javascript
    Sep 26

     

     

    If you want a text to blink below is the function.

    <SCRIPT type=text/javascript>
     

     

    function blink(idname) {
    var speed = 300;

     

          s = document.getElementById(idname);
    if (typeof(s) !== ‘undefined’)  {

    s.style.visibility=(s.style.visibility==’visible’)?’hidden’:’visible’;

    setTimeout(‘blink(\”+ idname +’\’)’,speed); 

    }

    }

     

    </SCRIPT>

    <body onload=”blink(‘blink_this_text’)”>
    <p id=blink_this_text> Blinking Text </p>

    </body>

     

    Summary: Upon loading the page, the onload function will call the blink function passing along the id of the paragraph, blink_this_text.  The blink speed is set to 300 milli  seconds interval. It then gets the blink_this_text object using the getElemenbById command. If it exists. Visibility is set to hidden if it is visible otherwise it’s invisible. The blinking text function is then called again using the setTimeout function.

    Hope this was helpful and happy coding!

30 Responses to “How to make a text Blink in Javascript.”

  1. Need cheap generic LEVITRA?…

  2. ..

    Buygeneric meds…

  3. Buynow it…

  4. ..

    Buyit now…

  5. ..

    Buywithout prescription…

  6. .

    Buynow it…

  7. Buywithout prescription…

  8. ..

    Buygeneric pills…

  9. ..

    Buyno prescription…

  10. Buygeneric drugs…

  11. ..

    Buynow it…

  12. Buygeneric drugs…

  13. .

    Buygeneric drugs…

  14. .

    Buynow it…

  15. .

    Buygeneric drugs…

  16. .

    Buygeneric drugs…

  17. .

    Buygeneric drugs…

  18. .

    Buygeneric meds…

  19. .

    Buyno prescription…

  20. .

    Buyno prescription luw…

  21. ..

    Buygeneric pills zdg…

  22. ..

    Buygeneric drugs krg…

  23. ..

    Buygeneric meds qmo…

  24. ..

    Buygeneric drugs lzt…

  25. Buywithout prescription xiu…

  26. Buygeneric meds svb…

  27. ..

    Buyno prescription wkp…

  28. ..

    Buyno prescription jui…

  29. Buyit now sge…


  30. BUY CHEAP INDIAN DRUGS : -==== Anti Depressants Drugs ====-

    Purchase Unique Pills Now!…

Leave a Reply