Login   Register  
PHP Classes
elePHPant
Icontem

File: js/treeview.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ian Lord  >  Class Treeview  >  js/treeview.js  >  Download  
File: js/treeview.js
Role: Auxiliary data
Content type: text/plain
Description: Javascript to actions
Class: Class Treeview
Display a collapsible tree of documents
Author: By
Last change:
Date: 2007-09-05 02:22
Size: 1,341 bytes
 

Contents

Class file image Download
function treeviewCollapseAll (sID){
	for (var x = 0; x<document.getElementById('objTree'+sID).getElementsByTagName('UL').length;x++){
		document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].style.display='none';
		document.getElementById('objTreeCollapser'+document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].id.substring(9,document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].id.length)).src = 'images/expander.gif';
	}
}

function treeviewExpandAll (sID){
	for (var x = 0; x<document.getElementById('objTree'+sID).getElementsByTagName('UL').length;x++){
		document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].style.display='block';
		document.getElementById('objTreeCollapser'+document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].id.substring(9,document.getElementById('objTree'+sID).getElementsByTagName('UL')[x].id.length)).src = 'images/collapser.gif';
	}
}
function treeviewExpandCollapse (sID){
	var objUL = document.getElementById('objTreeUL'+sID);
	var objCollapser = document.getElementById('objTreeCollapser'+sID);

	if (objUL.style.display == 'block'){
		objUL.style.display='none';
		objCollapser.src = 'images/expander.gif';
				
	}
	else {
		objUL.style.display='block';
		objCollapser.src = 'images/collapser.gif';
	}
}