mrtanooki
09-13-2004, 09:54 PM
goddamnit. i've been working on this code for three ****ing days now and i keep getting slapped left and right with browser incompatibilities.
here's the code:
<script type="text/javascript">
var menuKeys = new Array();
var menuVals = new Array();
var menuArray = new Array();
var lastOpen="default";
menuKeys = [["Don't talk to me.","No really, I mean it.","Do you want to get hurt?"],["I don't GIVE A ****","SHUT THE **** UP","GET THE **** OUT OF MY LIFE"],["GOD","****ING","DAMNIT"]];
menuVals = [["Hello!","Dolly","Why Hello!"],["Dolly","Its so nice","to have you back"],["where","you","belong"]];
function constructMenu() {
for (var item=0; item < menuKeys.length; item++) {
var subMenuList = document.createElement("ul");
for (var subitem=0; subitem < menuKeys[item].length; subitem++) {
var sublist = document.createElement("li");
var sublink = document.createElement("a");
sublink.setAttribute("href",menuVals[item][subitem]);
var node = document.createTextNode(menuKeys[item][subitem]);
sublink.appendChild(node);
sublist.appendChild(sublink);
subMenuList.appendChild(sublist);
}
var subMenu = subMenuList.appendChild(subMenuList);
menuArray.push(subMenu);
}
}
function expand(TagID) {
if (lastOpen !="default") {
menuTag.removeChild(menuArray[lastOpen]);
}
menuTag = document.getElementById(TagID);
menuTag.appendChild(menuArray[TagID]);
lastOpen = TagID;
}
</script>
<body onload="constructMenu()">
<ul Id="menu">
<li id="0" onmouseover="expand(0);" />Well hello there!
<li id="1" onmouseover="expand(1);" />My name is John!
<li id="2" onmouseover="expand(2);" />What is your name?
</ul>
</body>
somebody tell me where the hell i ****ed up. works PERFECTLY with IE6, not at all with Mozilla ****fox, and not at all with windows xp service **** 2
here's the code:
<script type="text/javascript">
var menuKeys = new Array();
var menuVals = new Array();
var menuArray = new Array();
var lastOpen="default";
menuKeys = [["Don't talk to me.","No really, I mean it.","Do you want to get hurt?"],["I don't GIVE A ****","SHUT THE **** UP","GET THE **** OUT OF MY LIFE"],["GOD","****ING","DAMNIT"]];
menuVals = [["Hello!","Dolly","Why Hello!"],["Dolly","Its so nice","to have you back"],["where","you","belong"]];
function constructMenu() {
for (var item=0; item < menuKeys.length; item++) {
var subMenuList = document.createElement("ul");
for (var subitem=0; subitem < menuKeys[item].length; subitem++) {
var sublist = document.createElement("li");
var sublink = document.createElement("a");
sublink.setAttribute("href",menuVals[item][subitem]);
var node = document.createTextNode(menuKeys[item][subitem]);
sublink.appendChild(node);
sublist.appendChild(sublink);
subMenuList.appendChild(sublist);
}
var subMenu = subMenuList.appendChild(subMenuList);
menuArray.push(subMenu);
}
}
function expand(TagID) {
if (lastOpen !="default") {
menuTag.removeChild(menuArray[lastOpen]);
}
menuTag = document.getElementById(TagID);
menuTag.appendChild(menuArray[TagID]);
lastOpen = TagID;
}
</script>
<body onload="constructMenu()">
<ul Id="menu">
<li id="0" onmouseover="expand(0);" />Well hello there!
<li id="1" onmouseover="expand(1);" />My name is John!
<li id="2" onmouseover="expand(2);" />What is your name?
</ul>
</body>
somebody tell me where the hell i ****ed up. works PERFECTLY with IE6, not at all with Mozilla ****fox, and not at all with windows xp service **** 2