|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
JScript / vb collapse function
Code:
function toggle_collapse(objid) { if (!is_regexp) { return false; } obj = fetch_object("collapseobj_" + objid); img = fetch_object("collapseimg_" + objid); cel = fetch_object("collapsecel_" + objid); if (!obj) { // nothing to collapse! if (img) { // hide the clicky image if there is one img.style.display = "none"; } return false; } if (obj.style.display == "none") { obj.style.display = ""; save_collapsed(objid, true); if (img) { img_re = new RegExp("_collapsed\\.gif$"); img.src = img.src.replace(img_re, '.gif'); } if (cel) { cel_re = new RegExp("^(thead|tcat)$"); cel.className = cel.className.replace(cel_re, '$1_collapsed'); cel_re = new RegExp("^(thead|tcat)(_collapsed)$"); cel.className = cel.className.replace(cel_re, '$1'); } } else { obj.style.display = "none"; save_collapsed(objid, false); if (img) { img_re = new RegExp("\\.gif$"); img.src = img.src.replace(img_re, '_collapsed.gif'); } if (cel) { cel_re = new RegExp("^(thead|tcat)$"); cel.className = cel.className.replace(cel_re, '$1_collapsed'); } } return false; } Thanks in advance for any advice - i have pretty much nil knowledge with JScript and have been fiddling with this for over an hour.
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#2
|
||
|
Could you put that into an actual project and attach the code?
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#3
|
||
|
click list and it collapses but i need to tbe collapsed when page loads
javascript:
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ Last edited by BeBop; 02-02-2006 at 04:40 PM. |
#4
|
||
|
Fixed it. changed the style attr on the tbody to display: none and it works now
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get the modified variable value in Java Script function in another HTML page ? | balmersmith | Web design and Programming | 0 | 12-06-2010 11:53 PM |
Help with Fatal error: Call to undefined function: imagecrea | sting013 | phphq.Net Forums | 1 | 02-16-2006 02:11 PM |
JScript Refresh | BeBop | Web design and Programming | 5 | 12-20-2005 11:32 AM |
f11 save function | jeffg | Delta Force | 3 | 12-09-2002 06:57 PM |
dflw save function | jeff- | Delta Force | 1 | 10-08-2002 04:06 PM |