Friday, August 22, 2014

Blink Effect with random colors using Javascript

Blink Effect with random colors using Javascript





Jquery Function For IE Browser

<script type="text/javascript">
        setInterval(colors, 1000); //Set Interval time
        function colors() {
            var color = "rgb("
            + Math.floor(Math.random() * 255) + ","
            + Math.floor(Math.random() * 255) + ","
            + Math.floor(Math.random() * 255) + ")";
            document.getElementById("txtName").style.color = color; //Get Element value and apply style for that element
        }
        </script>

HTML Code

<div id="txtName">CodeInnovators is a programming blog maintained by Vinothkumar S. Tutorials focused on Jquery,Ajax,PHP,HTML5,CSS3,Wordpress,Joomla,Drupal and MYSQL</div>

No comments:

Post a Comment