<body><script type="text/javascript">
var canvas = document.createElement('canvas');
canvas.setAttribute('width',300);
canvas.setAttribute('height',130);
canvas.setAttribute('style','float:left; border:1px solid #000; margin: 0 5px;');
var div = document.createElement('div');
var frame = document.createElement('iframe');
frame.setAttribute('src','about:blank');
frame.setAttribute('style','float:left; border:1px solid #000; height:130px; width: 300px;');
frame.onload = function(){
var framedoc = frame.contentDocument || frame.contentWindow && frame.contentWindow.document || frame.document;
framedoc.open();
framedoc.write('<html><body>',
'<a href="#">наведи</a>',
'</body></html>');
framedoc.close();
var link = framedoc.getElementsByTagName('a')[0];
var ctx = canvas.getContext('2d'),
imageData = ctx.createImageData(canvas.width,canvas.height),
data = imageData.data,
l = data.length,
timer = -1.
fr = 0;
function randomDraw(){
var i = l;
while(i--) data[i] = Math.floor(Math.random()*256);
ctx.putImageData(imageData,0,0);
div.innerHTML = 'Отрисовано ' + ++fr + ' кадров.';
timer = setTimeout(randomDraw,200)
}
link.onmouseover = randomDraw;
link.onmouseout =
window.onblur =
frame.onmouseout =
frame.onblur =
function(){ clearTimeout(timer) };
}
document.body.appendChild(frame);
document.body.appendChild(canvas);
document.body.appendChild(div);
</script></body>
Но зачем? -_-