PDA

View Full Version : Folding Tree Help with Indent



jim@cypressinland.com
08-25-2005, 03:43 PM
Original script: http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

See example at http://www.yardview.com/nested.htm

I want to reduce the amount of indentation. I read the posts but could not see where I would place the code. Any help would be appreciated. Thank you.

var head="display:''"
img1=new Image()
img1.src="..\CSS\ReportImages\fold2.gif"
img2=new Image()
img2.src="..\CSS\ReportImages\open2.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(..\\CSS\\ReportImages\\open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(..\\CSS\\ReportImages\\fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

jscheuer1
08-25-2005, 04:28 PM
I would need to see a working (or not working) example:

.

Twey
08-25-2005, 04:32 PM
img1.src="..\CSS\ReportImages\fold2.gif"
Never put backslashes in URIs. IE compensates, because MS would like every webserver to be more like their operating system. Everything else doesn't.
Try setting the margin-left:.