Hey Leute, hab ein kleines Problem mit meinem Code. Die Seite findet ihr unter http://w0rck.bplaced.net/Stadt/
Das Problem ist, dass sie Seite unter IE und Chrome so dargestellt wird wie sie soll aber unter FF nichts funktioniert. ;) Hab die leise Vermutung das es mit window.event zu tun hat. Kann mir jemand helfen? Hab den Code aus einer der .js hier angefügt.
Das Problem ist, dass sie Seite unter IE und Chrome so dargestellt wird wie sie soll aber unter FF nichts funktioniert. ;) Hab die leise Vermutung das es mit window.event zu tun hat. Kann mir jemand helfen? Hab den Code aus einer der .js hier angefügt.
Code:
var whichstyle = 1;
function onbutton1() {
if (whichstyle == 1) {
document.getElementById("button1").style.backgroundColor = "#726c72";
document.getElementById("leiste").style.backgroundColor = "#726c72";
} else if (whichstyle == 2) {
document.getElementById("button1").style.backgroundColor = "#a59e31";
document.getElementById("leiste").style.backgroundColor = "#a59e31";
}
}
function offbutton1() {
if (whichstyle == 1) {
document.getElementById("button1").style.backgroundColor = "#4a464a";
document.getElementById("leiste").style.backgroundColor = "#4a464a";
document.getElementById("button1").style.borderBottom = "1px solid #888";
} else if (whichstyle == 2) {
document.getElementById("button1").style.backgroundColor = "#d6c900";
document.getElementById("leiste").style.backgroundColor = "#d6c900";
document.getElementById("button1").style.borderBottom = "1px solid #888";
}
}
function onbutton() {
if (whichstyle == 1) {
document.getElementById(window.event.srcElement.id).style.backgroundColor = "#726c72";
} else if (whichstyle == 2) {
document.getElementById(window.event.srcElement.id).style.backgroundColor = "#a59e31";
}
}
function offbutton() {
if (whichstyle == 1) {
document.getElementById(window.event.srcElement.id).style.backgroundColor = "#4a464a";
} else if (whichstyle == 2) {
document.getElementById(window.event.srcElement.id).style.backgroundColor = "#d6c900";
}
}
function switchstyle() {
if (window.event.srcElement.id == "aa") {
document.getElementById("aa").style.border = "2px solid #000000";
document.getElementById("bb").style.border = "";
document.getElementsByTagName('link')[0].href = "css/style.css";
document.getElementById("button1").style.backgroundColor = "#4a464a";
document.getElementById("button2").style.backgroundColor = "#4a464a";
document.getElementById("button3").style.backgroundColor = "#4a464a";
document.getElementById("button4").style.backgroundColor = "#4a464a";
document.getElementById("button5").style.backgroundColor = "#4a464a";
document.getElementById("button6").style.backgroundColor = "#4a464a";
whichstyle = 1;
} else if (window.event.srcElement.id == "bb") {
document.getElementById("bb").style.border = "2px solid #FFFFFF";
document.getElementById("aa").style.border = "0px";
document.getElementsByTagName('link')[0].href = "css/alternativestyle.css";
document.getElementById("button1").style.backgroundColor = "#d6c900";
document.getElementById("button2").style.backgroundColor = "#d6c900";
document.getElementById("button3").style.backgroundColor = "#d6c900";
document.getElementById("button4").style.backgroundColor = "#d6c900";
document.getElementById("button5").style.backgroundColor = "#d6c900";
document.getElementById("button6").style.backgroundColor = "#d6c900";
whichstyle = 2;
}
}
var xmlHttpObject = false;
if ( typeof XMLHttpRequest != 'undefined') {
xmlHttpObject = new XMLHttpRequest();
}
if (!xmlHttpObject) {
try {
xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlHttpObject = null;
}
}
}
function loadContent() {
loadhtml();
loadgalery();
}
function loadgalery() {
if (window.event.srcElement.id == "button2") {
document.images[1].src = "img/poi2/1.jpg";
document.getElementById('1').href = "img/poi2/1.jpg";
}
if (window.event.srcElement.id == "button3") {
document.images[3].src = "img/poi2/1.jpg";
document.getElementById('1').href = "img/poi2/1.jpg";
}
if (window.event.srcElement.id == "button4") {
}
if (window.event.srcElement.id == "button5") {
}
if (window.event.srcElement.id == "button6") {
}
}
function loadhtml() {
if (window.event.srcElement.id == "button2") {
xmlHttpObject.open('get', 'pages/poi1.html');
} else if (window.event.srcElement.id == "button3") {
xmlHttpObject.open('get', 'pages/poi2.html');
} else if (window.event.srcElement.id == "button1") {
document.getElementById("button1").style.borderBottom = "0px";
} else if (window.event.srcElement.id == "button4") {
xmlHttpObject.open('get', 'pages/poi3.html');
} else if (window.event.srcElement.id == "button5") {
xmlHttpObject.open('get', 'pages/poi4.html');
} else if (window.event.srcElement.id == "button6") {
xmlHttpObject.open('get', 'pages/poi5.html');
} else if (window.event.srcElement.id == "startseite") {
xmlHttpObject.open('get', 'pages/startseite.html');
} else if (window.event.srcElement.id == "impressum") {
xmlHttpObject.open('get', 'pages/impressum.html');
} else if (window.event.srcElement.id == "feedback") {
xmlHttpObject.open('get', 'pages/feedback.html');
}
xmlHttpObject.onreadystatechange = handleContent;
xmlHttpObject.send(null);
return false;
}
function handleContent() {
if (xmlHttpObject.readyState == 4) {
document.getElementById('textfeld').innerHTML = xmlHttpObject.responseText;
}
}