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 Mike Lewis 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
0
0
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
 

just remove/modify this line (at the bottom)

> document.ondblclick=expando

if you want to colapse the left frame when you click on an image, use this:

<a href=&quot;#&quot; onClick=&quot;expando(); return false;&quot;><img src=&quot;theImagesUrlHere&quot; border=0></a>

also, you could do this for when you doubleclick:

<a href=&quot;#&quot; ondblclick=&quot;expando(); return false;&quot;><img src=&quot;theImagesUrlHere&quot; border=0></a>

Hope this helps
theEclipse
eclipse_web@hotmail.com
robacarp.webjump.com
**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top