Hi all,
I unfortunately am having another problem with another page:(. I opened it up before I started work on it and I got error messages right away:(. I think that, somehow, Course Technology(the publisher of my Dynamic HTML textbook) is trying to sabotage me as well as the other Dynamic HTML students. The horizontal lines are there just to (hopefully) isolate the problem
Anyways, here's the code:
<SCRIPT LANGUAGE="javascript">
<!--
Nav4 = (document.layers) ? 1:0;
IE4 = (document.all) ? 1:0;
ver4 =(Nav4 || IE4)?1:0;
function getNumber(el) {
num=null;
for (i=0; i<document.layers.length; i++) {
theEl=document.layers[i];
if (theEl.id==el) {
num=i;
break;
}
}
return num;
}
function arrange() {
nextY=document.layers[firstNum].pageY + document.layers[firstNum].document.height-10;
for (i=firstNum+1; i<document.layers.length; i++) {
theEl=document.layers[i];
if (theEl.visibility != "hide") {
theEl.pageY=nextY;
nextY += theEl.document.height-10;
}
}
}
function init(){
if (Nav4) {
for (i=0; i<document.layers.length; i++) {
theEl=document.layers[i];
if (theEl.id.indexOf("Answer") != -1) {
theEl.visibility="hide";
theEl.expanded=false;
}
}
arrange();
}
else {
tempColl=document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "answer") {
tempColl(i).style.display="none";
tempColl(i).expanded=false;
}
}
}
}
function expand(el) {
if (!ver4) return;
if (IE4) {
expandIE(el)
}
else {
expandNav(el)
}
}
function expand IE(el){
theEl=eval(el+"Answer");
if(theEl.style.display=="none"){
theEl.style.display="block";
theEl.expanded=true;
}
else{
theEl.style.display="none";
theEl.expanded="false
}
}
function expandNav(el) {
theEl=eval("document." + el + "Answer");
if (theEl.visibility == "hide") {
theEl.visibility="show";
theEl.expanded=true;
}
else {
theEl.visibility="hide";
theEl.expanded=false;
}
arrange();
}
function showAll() {
for (i=firstNum; i<document.layers.length; i++) {
theEl=document.layers[i];
theEl.visibility="show";
}
}
with (document) {
write("<STYLE TYPE='text/css'>");
if (Nav4) {
write(".question {position: absolute; visibility: hidden; left: 40px}");
write(".answer {position: absolute; visibility: hidden; left: 50px; width: 90%}");
}
else {
write(".question {position: relative; left: 40px}");
write(".answer {display: none; position: relative; left: 50px; width: 90%}");
}
write("</STYLE>");
}
window.onload=init;
//-->
</SCRIPT>
HELP!
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114
Go there. I have a lot of awesome photos that I rendered myself
"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"