-
Help Modifing Working Script
I have a working script that opens each table when clicked on. I want to have the tables open when the page loads for the first time. Currently the tables are hidden when the page loads for the first time. The script uses cookies to remember tables position. Can any help with this?
The current working script is below:
!--
function clickHandler() {
var targetId, srcElement, targetElement, srcId;
if (window.event) srcElement = window.event.srcElement;
else srcElement = clickHandler.arguments[0].target;
if (srcElement.className == "Outline") {
srcId = srcElement.id
if (srcElement.tagName.toLowerCase() == "img")
srcId = srcId.substr(0,srcElement.id.length-1);
targetId = srcId + "d";
if (document.getElementById) targetElement = document.getElementById(targetId);
else if (document.all) targetElement = document.all(targetId);
else return;
if (targetElement.style.display == "none") {
targetElement.style.display = "";
document.images(srcId + "i").src = "images/print.gif";
setCookie( targetId, "show" );
} else {
targetElement.style.display = "none";
document.images(srcId + "i").src = "images/print.gif";
setCookie( targetId, "none" );
}
}
}
function setCookie(name, value) {
document.cookie = name + "=" + escape(value);
}
function readtree() {
var dc = document.cookie;
if (dc.length > 0) {
ca = dc.split(";");
for ( c in ca ) {
mid = ca[c].indexOf("=");
if (ca[c].charAt(0) == " ") targetId = ca[c].substring(1,mid);
else targetId = ca[c].substring(0,mid);
if ( targetId.substr(0,3) != "Out") continue;
val = ca[c].substr(mid+1,4);
if (document.getElementById) targetElement = document.getElementById(targetId);
else if (document.all) targetElement = document.all(targetId);
else return;
if (val == "show") {
targetElement.style.display = "";
document.images(targetId.substr(0,targetId.length-1)+"i").src = "images/print.gif";
}
}
}
}
document.onclick = clickHandler;
//-->
</script>
------------------------------------------------------
<body onload="readtree();">
<div id="Out0d">
<dl>
<dt><span id="Out1" class="Outline" style="cursor: hand"><img src="images/print.gif" alt="print" width="19" height="18" hspace="4" class="Outline" id="Out1i" />WHAT EVER</span></dt>
<dd>
<div id="Out1d" style="display:None;">
<dl>
<dt><TABLE>
</TABLE>
</dt>
</dl>
</div>
</dd>
Similar Threads
-
By Cantagon in forum Java
Replies: 0
Last Post: 05-08-2006, 12:42 PM
-
By bubberz in forum ASP.NET
Replies: 2
Last Post: 08-23-2005, 02:19 PM
-
By Alintex in forum dotnet.announcements
Replies: 0
Last Post: 12-16-2002, 03:30 AM
-
By Chris in forum Database
Replies: 3
Last Post: 08-20-2002, 12:14 AM
-
By Lakshmeenarayana G G in forum Enterprise
Replies: 0
Last Post: 02-05-2002, 09:43 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|