Hi habe so ein tolles Javascript im INet gefunden, mit dem man Texte in Form von einem Kreis rotieren lassen kann. Nun wollte ich aber zwei Texte rotieren lassen, also habe uch das SCRIPT MIT ANDEREN BEZEICHNUNGEN nochmal eingefügt:
<script language="JavaScript">
rotation = new Array();
//rotation[x] = new Array("href","linkname","beschreibung/desc");
rotation[0] = new Array("#","Morphologie","Link1");
rotation[1] = new Array("#","Phänografie","Link2");
rotation[2] = new Array("#","Sportpsychologie","Link3");
rotation[3] = new Array("#","Sportpädagogik","Link4");
rotation[4] = new Array("#","Biomechanik","Link5");
rotation[5] = new Array("#","Trainingslehre","Link6");
rotation[6] = new Array("#","Theorie der Sportarten","Link7");
rotation[7] = new Array("#","Sportbiologie","Link8");
rotation[8] = new Array("#","Sportmedizin","Link9");
screenb = screen.availWidth;
screenh = screen.availHeight
r = 120; // radius
xoff = (screenb / 2) - 73; // x offset
yoff = 3300; // y offset
x1 = xoff + 0; //Bildposition links
y1 = yoff - 0; //Bildposition oben
descleft = xoff - 99; //desc-Position links
desctop = yoff + 55; //desc-Position oben
pi = Math.PI; // PI
inc = (pi/r); // (links drehen)
// inc = -(pi/190); // (rechts drehen)
document.write("<style type="text/css">.desc{left:" + descleft + ";top:" + desctop + ";}</style>");
function showObject(object) {object.visibility = VISIBLE;}
function hideObject(object) {object.visibility = HIDDEN;}
function slideLogo(from, to) {
if (from < to) {
company.top = (from += 20); //standard. 4
setTimeout('slideLogo(' + from + ',' + to + ')', 30); //standard. 75
}
else initObjects();
}
function initObjects() {
objects = new Array();
for(x=1; x<=rotation.length; x++){
eval("objects.push(fly" + x + ");");
}
pos = new Array();
pos[0] = 0;
for (x=1; x<objects.length; x++) {
pos[x] = parseFloat(pos[x - 1] + ((2 * pi) / objects.length));
}
rotateObjects();
}
function rotateObjects() {
for (x=0; x<pos.length; x++) {
pos[x] += inc;
objects[x].visibility = 'visible';
objects[x].left = (r * Math.cos(pos[x])) + xoff;
objects[x].top = (r * Math.sin(pos[x])) + yoff;
}
rotateTimer = setTimeout("rotateObjects()",60);
}
document.write("<div id="company" class="logo"><p><a href="#">Bewegungs-<br>lehre</a></p></div>");
for(x=1; x<=rotation.length; x++){
document.write("<div id="fly" + x + "" class="fly"><p><a onMouseOver="clearTimeout(rotateTimer);" onMouseOut="rotateObjects();" href="" + rotation[x-1][0] + "">" + rotation[x-1][1] + "</a><br></p></div>");
}
for(x=1; x<=rotation.length; x++){
document.write("<div align="center" id="desc" + x + "" class="desc"><p>" + rotation[x-1][2] + "</p></div>");
}
if (document.getElementById) {
before = "document.getElementById('";
after = "').style";
var HIDDEN = "hidden";
var VISIBLE = "visible";
}
else if (document.all) {
before = "document.all.";
after = ".style";
var HIDDEN = "hidden";
var VISIBLE = "visible";
}
else if (document.layers) {
before = "document.";
after = "";
var HIDDEN = "hide";
var VISIBLE = "show";
}
for(x=1; x<=rotation.length; x++) {
eval("var fly" + x + " = " + before + "fly" + x + after);
}
eval("var company = " + before + "company" + after);
for(x=1; x<=rotation.length; x++) {
eval("var desc" + x + " = " + before + "desc" + x + after);
}
slideLogo(0,y1);
function stop() {
inc=pi/100000000;
}
</script>
<script language="JavaScript">
rotation1 = new Array();
//rotation1[x1] = new Array("href","linkname","beschreibung/desc");
rotation1[0] = new Array("#","Mathematik","Link1");
rotation1[1] = new Array("#","Medizin","Link2");
rotation1[2] = new Array("#","Biologie","Link3");
rotation1[3] = new Array("#","Pädagogik","Link4");
rotation1[4] = new Array("#","Psychologie","Link5");
rotation1[5] = new Array("#","Pädagogik","Link6");
screenb1 = screen.availWidth;
screenh1 = screen.availHeight
r1 = 120; // radius
xoff1 = (screenb1 / 2) - 73; // x offset
yoff1 = 3600; // y offset
x11 = xoff1 + 0; //Bildposition links
y11 = yoff1 - 0; //Bildposition oben
descleft1 = xoff1 - 99; //desc-Position links
desctop1 = yoff1 + 55; //desc-Position oben
pi1 = Math.PI; // PI
inc = (pi1/r1); // (links drehen)
// inc = -(pi/190); // (rechts drehen)
document.write("<style type="text/css">.desc{left:" + descleft1 + ";top:" + desctop1 + ";}</style>");
function showObject(object) {object.visibility = VISIBLE;}
function hideObject(object) {object.visibility = HIDDEN;}
function slideLogo1(froma, toa) {
if (froma < toa) {
company.top = (froma += 20); //standard. 4
setTimeout('slideLogo1(' + froma + ',' + toa + ')', 30); //standard. 75
}
else initObjects1();
}
function initObjects1() {
objects1 = new Array();
for(x1=1; x1<=rotation1.length; x1++){
eval("objects1.push(fly" + x1 + ");");
}
pos1 = new Array();
pos1[0] = 0;
for (x1=1; x1<objects1.length; x1++) {
pos1[x1] = parseFloat(pos1[x1 - 1] + ((2 * pi) / objects1.length));
}
rotateObjects1();
}
function rotateObjects1() {
for (x1=0; x1<pos1.length; x1++) {
pos1[x1] += inc;
objects1[x1].visibility = 'visible';
objects1[x1].left = (r1 * Math.cos(pos1[x1])) + xoff1;
objects1[x1].top = (r1 * Math.sin(pos1[x1])) + yoff1;
}
rotateTimer1 = setTimeout("rotateObjects1()",60);
}
document.write("<div id="company" class="logo"><p><a href="#">Kinesio-<br>logie</a></p></div>");
for(x1=1; x1<=rotation1.length; x1++){
document.write("<div id="fly" + x1 + "" class="fly"><p><a onMouseOver="clearTimeout(rotateTimer1);" onMouseOut="rotateObjects1();" href="" + rotation1[x1-1][0] + "">" + rotation1[x1-1][1] + "</a><br></p></div>");
}
for(x1=1; x1<=rotation1.length; x1++){
document.write("<div align="center" id="desc" + x1 + "" class="desc"><p>" + rotation1[x1-1][2] + "</p></div>");
}
if (document.getElementById) {
before1 = "document.getElementById('";
after1 = "').style";
var HIDDEN = "hidden";
var VISIBLE = "visible";
}
else if (document.all) {
before1 = "document.all.";
after1 = ".style";
var HIDDEN = "hidden";
var VISIBLE = "visible";
}
else if (document.layers) {
before1 = "document.";
after1 = "";
var HIDDEN = "hide";
var VISIBLE = "show";
}
for(x1=1; x1<=rotation1.length; x1++) {
eval("var fly" + x1 + " = " + before1 + "fly" + x1 + after1);
}
eval("var company = " + before1 + "company" + after1);
for(x1=1; x1<=rotation1.length; x1++) {
eval("var desc" + x1 + " = " + before1 + "desc" + x1 + after1);
}
slideLogo1(0,y11);
function stop() {
inc=pi/100000000;
}
</script>
Jetzt Funktioniert nix mehr, bzw. ist das ganze nun zum Kauderwelsch geworden!!! :-(
Kann mir da jemand helfen????
Danke schon jetzt für all eure Antworten!!!