Scarlett Scarlett - 1 year ago 78
CSS Question

How to add randomness to the blink effect?


(function blink() {
$('.demo').fadeOut(500).fadeIn(400, blink);


.demo {
background: url('../res/logo.png') no-repeat;
width: 200px;
height: 200px;
margin-top: 355px;
margin-left: 855px;

How do i add randomness to this blinking effect?

Answer Source

This is as good as my answer can get until the question gets more specific:

(function blink() {
  $('.demo').fadeOut(Math.random()*500).fadeIn(Math.random()*400, blink); 
<script src=""></script>
<span class="demo">I'm blinking!</span>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download