|
Elastischer Text mit DHTML
Dies ist elastischer Text...Funktioniert leider nur mit Internet Explorer. Sourcecode:
<head>
<script language="JavaScript">
// Array of sizes to cycle over
var sizes = new Array("0px", "1px", "2px", "4px", "8px");
sizes.pos = 0;
function rubberBand() {
var el = document.all.elastic;
if (null == el.direction)
el.direction = 1;
else if ((sizes.pos > sizes.length - 2) ||
(0 == sizes.pos))
el.direction *= -1;
el.style.letterSpacing = sizes[sizes.pos += el.direction];
}
</script>
</head>
<body onload="window.tm = setInterval('rubberBand()', 150);" onunload="clearInterval(window.tm);">
<h3 id="elastic" align="center">Dies ist elastischer Text</h3>
|