Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   collapsible frames (http://www.bvlist.com/showthread.php?t=8901)

djjohnnyb 20th February 2013 02:20

collapsible frames
 
hi am looking how to make all the frames on index collapsible so ppl can close them down

any help would be gr8

fireknight 20th February 2013 07:58

Add this to your JS files.

hideshow.js
Code:

function getObject(id)
{
      var obj = null;

      if(document.getElementById)
          obj = document.getElementById(id);
      else if(document.all)
          obj = document.all[id];
      else if(document.layers)
          obj = document.layers[id];

      return obj;
}


function toggleObject(id)
      {
      var obj = getObject(id);


      if(!obj)
          return false;

      if(obj.style.display == 'none')
      {
          obj.style.display = '';
      }

      else
      {
          obj.style.display = 'none';
      }

      return true;
}

In index.php

Add ( Change the location to suit where you keep your js files )
Code:



Then for your index frames

Example Site Stats

Code:

Site Stats  Show / Hide


You can use this for any frame.
Just make sure that the, toggleObject name and the id name are the same.

!toggleObject('stats')
id="stats"

djjohnnyb 20th February 2013 09:21

ty
 
1 Attachment(s)
ty m8 a will give it ago now

it works fine on ma stats but cant get it going on the rest gives me a white page

here is ma index see what u think

DND 20th February 2013 12:37

or could use java klappe

fireknight 20th February 2013 14:35

1 Attachment(s)
I have done your online now and last 24 hours.
See if it works, if it does.
See how I have changed the name and id to match.
Just do the same for all your frames.

djjohnnyb 20th February 2013 15:38

hi
 
yip that works but when a try adding it to the rest its a white page am trying to add it to it all part from shout

DND 20th February 2013 15:41

you are probably missing a
tag

djjohnnyb 20th February 2013 15:45

hi
 
am adding it like he said am just thick a think lol

Chez 20th February 2013 16:31

Or you can try this:

PHP Code:

<script language="javascript">
<!--

var 
state 'none';

function 
showhide(layer_ref) {

if (
state == 'block') {
state 'none';
}
else {
state 'block';
}
if (
document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." layer_ref ".style.display = state");
}
if (
document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display state;
}
if (
document.getElementById &&!document.all) {
hza document.getElementById(layer_ref);
hza.style.display state;
}
}
//-->
</script> 
<b></b> <a href="javascript:;" onclick="showhide('div1');"><b>Click Heres&nbsp;[Show/Hide]</b></a>
<div id="div1" style="display: none;"> 


and after this ... add your content

djjohnnyb 20th February 2013 21:46

hi
 
av tryed that to and nothng a must just be really thick pmsl


All times are GMT +2. The time now is 13:29.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.