Search This Blog

Sunday, August 11, 2013

Blinking-text-using-jquery



1<!DOCTYPE html>
2
<html>


3
<head>
4
<meta charset="utf-8">

5
<title>Blinking Text | istockphp.com</title>
6
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

7
<script type="text/javascript">
8
$(function() {

9
    var x;
10
        setInterval(function() {





11
                if(x == 0) {
12
                    $('.blinking').removeAttr('style');

13
                    x = 1;
14
                } else  {

15
                    if(x = 1) {
16
                        $('.blinking').css('color', 'red');

17
                        x = 0;
18
                    }

19
                }
20
        }, 500);

21
});
22
</script>

23

24
</head>

25

26
<body>

27
    <p class="blinking">istockphp.com</p>
28
</body>

29
</html>
Continue Reading...