Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
Thread Tools
  #1  
Old 20th February 2013, 02:20
djjohnnyb djjohnnyb is offline
Member
 
Join Date: Oct 2009
P2P
Posts: 12
Default 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
Reply With Quote
  #2  
Old 20th February 2013, 07:58
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
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:
<script type="text/javascript" src="jsfiles/hideshow.js"></script>

Then for your index frames

Example Site Stats

Code:
<div align="center">Site Stats&nbsp;&nbsp;<a href="#" onclick="return !toggleObject('stats');">Show / Hide</a></div>
<div align="center" id="stats" style="display:none;">

Site stats code goes here

</div>
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"
Reply With Quote
  #3  
Old 20th February 2013, 09:21
djjohnnyb djjohnnyb is offline
Member
 
Join Date: Oct 2009
P2P
Posts: 12
Default ty
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
Attached Files
File Type: php index.php (53.2 KB, 12 views)

Last edited by djjohnnyb; 20th February 2013 at 10:05.
Reply With Quote
  #4  
Old 20th February 2013, 12:37
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,242
Default
or could use java klappe
Reply With Quote
  #5  
Old 20th February 2013, 14:35
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
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.
Attached Files
File Type: php index.php (53.4 KB, 39 views)
Reply With Quote
  #6  
Old 20th February 2013, 15:38
djjohnnyb djjohnnyb is offline
Member
 
Join Date: Oct 2009
P2P
Posts: 12
Default 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
Reply With Quote
  #7  
Old 20th February 2013, 15:41
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,242
Default
you are probably missing a </div> tag
Reply With Quote
  #8  
Old 20th February 2013, 15:45
djjohnnyb djjohnnyb is offline
Member
 
Join Date: Oct 2009
P2P
Posts: 12
Default hi
am adding it like he said am just thick a think lol
Reply With Quote
  #9  
Old 20th February 2013, 16:31
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default
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
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif

Last edited by Chez; 20th February 2013 at 18:54.
Reply With Quote
  #10  
Old 20th February 2013, 21:46
djjohnnyb djjohnnyb is offline
Member
 
Join Date: Oct 2009
P2P
Posts: 12
Default hi
av tryed that to and nothng a must just be really thick pmsl
Reply With Quote
Reply

Tags
collapsible , frames


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 07:22. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.