|
|
|
@ -1,10 +1,15 @@ |
|
|
|
|
|
|
|
|
|
function simpleMachicharaUpdater(element) { |
|
|
|
|
return function() { |
|
|
|
|
simpleMachicharaUpdate(element); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function simpleMachicharaUpdate(element) { |
|
|
|
|
clearTimeout(element.interval); |
|
|
|
|
element.style.top = Math.floor(Math.random()*90) + "%"; |
|
|
|
|
element.style.left = Math.floor(Math.random()*90) + "%"; |
|
|
|
|
window.setTimeout(function() { |
|
|
|
|
simpleMachicharaUpdate(element); |
|
|
|
|
}, 5000+Math.floor(Math.random()*25000)); |
|
|
|
|
element.interval = window.setTimeout(simpleMachicharaUpdater(element), 5000+Math.floor(Math.random()*25000)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function simpleMachichara(imageUrl) { |
|
|
|
@ -18,5 +23,6 @@ function simpleMachichara(imageUrl) { |
|
|
|
|
machicharaSimpleImageElement.src = imageUrl; |
|
|
|
|
machicharaSimpleImageElement.style.border = "none"; |
|
|
|
|
machicharaSimpleElement.appendChild(machicharaSimpleImageElement); |
|
|
|
|
machicharaSimpleElement.onmouseover = simpleMachicharaUpdater(machicharaSimpleElement); |
|
|
|
|
simpleMachicharaUpdate(machicharaSimpleElement); |
|
|
|
|
} |