Mam takie cos:
- Kod: Zaznacz cały
<?xml version="1.0" encoding="iso-8859-2"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<script language="JavaScript1.2">
hex=255 // Initial color value.
function fadetext(){
if(hex>0) { //If color is not black yet
hex-=11; // increase color darkness
document.getElementById("sample").style.color="rgb("+hex+","+hex+","+hex+")";
setTimeout("fadetext()",20);
}
else
hex=255 //reset hex value
}
</script>
<meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-2" />
</head>
<body>
<div id="sample" style="width:100%">John slowly faded into view</div>
<button onClick="fadetext()">Fade Text</button>
</body>
</html>
~
~
~
Co zrobic aby tekst wylanial sie zaraz po zaladowaniu strony, bez oczekiwania na nacisniecie przycisku?
Pozdrawiam