var images = [ { probability: .4, url: "venus.png"}, { probability: .3, url: "funnyvenus.png"}, ]; images.sort(function (a, b) { return a.probability - b.probability; }); function getImageUrl(images) { var rand = Math.random(); var sum = 0; for(var i=0; i < images.length; i++) { sum += images[i].probability; if(rand <= sum ) { return images[i]; } } }
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyfra
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyfra
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyfra
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyfra
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyfra
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }div { -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }
test
{ -webkit-animation: action 1s infinite alternate; animation: action 1s infinite alternate; } @-webkit-keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes action { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }