Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collapsible Left Frame

Status
Not open for further replies.

neilmunn

Technical User
Jan 9, 2001
5
GB
I have been given the following script to collapse the left navigation frame. Does anyone know how to modify it so I can click on a button (expand & collapse, rather than double click on the frame?

I've seen it done but I'm not sure were.

<script language=&quot;JavaScript1.2&quot;>
/*
Collapsible Left Frame Script-
© Dynamic Drive (
defaultconf=''
function expandf(){
if (document.all){
if (document.body.cols!=&quot;10,*&quot;)
document.body.cols=&quot;10,*&quot;
else
document.body.cols=defaultconf
}
}
</script>


<script language=&quot;JavaScript1.2&quot;>
/*
Collapsible Left Frame Script-
© Dynamic Drive (*/

if (document.all)
window.parent.defaultconf=window.parent.document.body.cols
function expando(){
window.parent.expandf()
}
document.ondblclick=expando
</script>


Thanks

Neil Munn
neilmunn@ukonline.co.uk
 
Would you want a text or form button to do this?

If you want a text button, within the a tag, do something like this:

[tt]<a href=&quot;#&quot; onClick=&quot;javascript:expandf()&quot;>click here</a>[/tt]

Or something like this if you want a form button:

[tt]
<input type=button onClikc=&quot;javascript:expandf()&quot;>
[/tt]

I think that should do it.

Hope this helps.


-Vic

vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top