Programalama > JAVA SCRIPT

Etiketler: hareketli, yazi

Ort. 0
Puan ver:
<html>
<title>Hareketli Yazı</title>
<head>
<style type="text/css">
	#j1 {position:absolute; left:50; top:100; width:40; z-index:1}
	#a1 {position:absolute; left:90; top:100; width:40; z-index:2}
	#v1 {position:absolute; left:130; top:100; width:40; z-index:3}

	#a2 {position:absolute; left:170; top:100; width:40; z-index:4}
	#s1 {position:absolute; left:210; top:100; width:40; z-index:5}
	#c1 {position:absolute; left:250; top:100; width:40; z-index:6}
	#r1 {position:absolute; left:290; top:100; width:40; z-index:7}
	#i1 {position:absolute; left:330; top:100; width:40; z-index:8}
	#p1 {position:absolute; left:370; top:100; width:40; z-index:9}
                  #k1 {position:absolute; left:410; top:100; width:40; z-index:10}
</style>
<script language="JavaScript">

var isNav = false;
var isIE = false;

var obj;
var sinTab;
var pos = 0;
var schritte = 15;
var schrittweite = (2*Math.PI)/schritte;


function init() {

	// Mindestens Version 4.0
	if (parseInt(navigator.appVersion) >= 4) {
	
		// Browser bestimmen
		if (navigator.appName.indexOf("Netscape") != -1) {
			isNav = true;
		} 
		if (navigator.appName.indexOf("Microsoft") != -1) {
			isIE = true;
		}
	}

	// Animation starten
	if (isNav || isIE) {
		sinTab = erzeugeSinTab();
		obj = erzeugeArray("j1", "a1", "v1", "a2", "s1", 
							"c1", "r1", "i1", "p1");
					
		setInterval("bewege()", 100);
	} else {
		alert("Sie benoetigen entweder den Netscape " +
			"Communicator 4.0\noder den Microsoft " +
			"Internet Explorer 4.0.");
	}
  
}

// Erzeugt Tabelle mit y-Koordinaten
function erzeugeSinTab() {
	var tab = new Array();
	var posx = 0;
	for (i = 0; i <= schritte+8 ; i++) {
		tab[i] = Math.round(Math.sin(posx) * 50) + 100;
		posx += schrittweite;
	}
	
	return tab;
}

// Erzeugt Array der positionierbaren Elemente
function erzeugeArray() {
	var objList = new Array();

	for (var i = 0; i < erzeugeArray.arguments.length; i++) {
		if (isNav) {
			objList[i] = document.layers[erzeugeArray.arguments[i]];
		} else {
			objList[i] = document.all[erzeugeArray.arguments[i]].style;
		}
	}
	
	return objList;
}

// Animiert positionierbare Elemente
function bewege() {
	var num = 0;

	for (i in obj) {
		if (isNav) {
			obj[i].top = sinTab[pos+num];
		} else {
			obj[i].pixelTop = sinTab[pos+num];
		}
		num++;
	}

	pos++;
	if (pos >= schritte) pos = 0;
}

</script>
<BODY onLoad="init()">
<div id="j1"><FONT COLOR="#FF0000" SIZE="6" FACE="Arial Black">E</FONT></div>

<div id="a1"><FONT COLOR="#00CC66" SIZE="6" FACE="Arial Black">s</FONT></div>

<div id="v1"><FONT COLOR="#FF00CC" SIZE="6" FACE="Arial Black">p</FONT></div>

<div id="a2"><FONT COLOR="#FF9900" SIZE="6" FACE="Arial Black">r</FONT></div>

<div id="s1"><FONT COLOR="#0033FF" SIZE="6" FACE="Arial Black">i</FONT></div>

<div id="c1"><FONT COLOR="#E0E300" SIZE="6" FACE="Arial Black">.</FONT></div>

<div id="r1"><FONT COLOR="#CC6600" SIZE="7" FACE="Arial Black">N</FONT></div>

<div id="i1"><FONT COLOR="#CC00FF" SIZE="6" FACE="Arial Black">e</FONT></div>

<div id="p1"><FONT COLOR="#00EDF0" SIZE="6" FACE="Arial Black">t</FONT></div>

<div id="k1"><FONT COLOR="#00EDF0" SIZE="6" FACE="Wingdings"><b>N</b></FONT></div>

</body>
</head>
</html>


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.