Forum Moderators: open

Message Too Old, No Replies

Simple open/close script

does it exist?

         

Acternaweb

2:25 pm on Feb 7, 2004 (gmt 0)

10+ Year Member



Hi,

I am looking for a simple open/close script (+/-) where content is displayed upon it being clicked. does a simple script exist?

DrDoc

5:23 pm on Feb 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You mean, expand and contract... sort of the way directory trees work in Windows?

Acternaweb

7:01 pm on Feb 9, 2004 (gmt 0)

10+ Year Member



Yes in a way, so the user/vistor would be able to see all the cotent or none of the content; similar to windows explorer.

isitreal please keep the propaganda or whatever you sent to yourself, I am not intersted in the cause. Thanks,

txbakers

7:06 pm on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure, it's done with divs and styles to hide or show the object.

DrDoc

7:14 pm on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...or better yet -- done with lists :)

isitreal

7:16 pm on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Acternaweb: The link I sent you was an example of a website that uses the script you are looking for, it's a normal Catalan (spain) newspaper, I'm not sure what you're referring to here, at least that's what I thought I sent you a link to.

Acternaweb

1:41 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



<<Sure, it's done with divs and styles to hide or show the object. >>

Ok well how do you do that? Examples would be helpful, thanks

txbakers

2:06 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



here's the function:
function showNon(){
if (document.formSel.classifi.value == "Non-Varsity" ¦¦ document.formSel.classifi.value == "Sub Non-Varsity"){
document.formSel.nonvar.style.display='';
} else {
document.formSel.nonvar.style.display='none';
document.formSel.nonvar.value = '';
}
}

and here is how you call it:

<td class="bstxt" height="26">Performing Group Type
<select class="inputbox" name="classifi" onChange="showNon()">
<option value="">Select</option>
<option value="Varsity">Varsity</option>
<option value="Non-Varsity">Non-Varsity</option>
<option value="Sub Non-Varsity">Sub Non-Varsity</option>
<option value="Combined">Combined</option>
</select>
&nbsp;<select class="inputbox" name="nonvar" style="display:none"><option value=""></option><option value="A">A</option><option value="B">B</option><option value="C">C</option><option value="D">D</option><option value="E">E</option><option value="F">F</option></select>&nbsp;Check for Composite Group&nbsp;<input type="checkbox" name="compos" value="Y" class="inputbox">
</td>

The first drop down is a list of classifications. When they select one, the onChange method is fired which calls the function. If the value matches on the key ones, it sets the style of the display attribute of the second dropdown box to '' (true) and you can see the second box.