I finally got my code to work so that my tree can expand and collapse,
however,
when I started to piece all my code to the final page,
I'v noticed that my expand and collapse will not work with my left.include file
why? because it has div tags gradient style
is there a way I cannot use <div> in my javascript code..
I am totally new to this line of work, lovin it, though, here is the javacode example:
function Toggle(item) {
obj=document.getElementById(item);
visible=(obj.style.display!="none")
key=document.getElementById("x" + item);
if (visible) {
obj.style.display="none";
key.innerHTML="<img src='assets/images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
} else {
obj.style.display="block";
key.innerHTML="<img src='assets/images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
function Expand() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs.style.display="block";
key=document.getElementById("x" + divs.id);
key.innerHTML="<img src='assets/images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
function Collapse() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs.style.display="none";
key=document.getElementById("x" + divs.id);
key.innerHTML="<img src='assets/images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
Thanks a lot, and remember explain it to me like a 12 year old...
however,
when I started to piece all my code to the final page,
I'v noticed that my expand and collapse will not work with my left.include file
why? because it has div tags gradient style
is there a way I cannot use <div> in my javascript code..
I am totally new to this line of work, lovin it, though, here is the javacode example:
function Toggle(item) {
obj=document.getElementById(item);
visible=(obj.style.display!="none")
key=document.getElementById("x" + item);
if (visible) {
obj.style.display="none";
key.innerHTML="<img src='assets/images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
} else {
obj.style.display="block";
key.innerHTML="<img src='assets/images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
function Expand() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs.style.display="block";
key=document.getElementById("x" + divs.id);
key.innerHTML="<img src='assets/images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
function Collapse() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs.style.display="none";
key=document.getElementById("x" + divs.id);
key.innerHTML="<img src='assets/images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
Thanks a lot, and remember explain it to me like a 12 year old...