4 Replies - 824 Views - Last Post: 01 March 2009 - 11:37 AM

#1 jakev383  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 41
  • Joined: 27-May 08

Need help with collapsing menu and iframes

Posted 26 February 2009 - 01:59 PM

I have a menu that starts out expanded and displays an iframe in each menu item.
I'm not up on my java and grabbed this code from somewhere on the 'net, so I need help with the code to do the following:
start some items collapsed, and others expanded
when the main page opens, it jumps down to the bottom of the main page - how do I get it to stay at the top?

I'm trying to "freshen" up the project site some and make it more usable. Here's the test site: http://qmailtoaster.com/test.html
Here's the code:
<!--  Begin Javascript for expanding menus -->

<script>
function ShowHide(tab) {
	  var t = document.getElementById(tab);
	  if (t.style.display == '') {
			t.style.display = 'none';
			t.style.visibility = 'hidden';
	  }
	  else {
			t.style.display = '';
			t.style.visibility = 'visible';
	  }
}

function ShowAll() {
	  var t = document.getElementById('info');
	  for (var i = 0; i < t.rows.length; i++) {
			if (t.rows[i].id != "control") {
				  t.rows[i].style.display = '';
				  t.rows[i].style.visibility = 'visible';
			}
	  }
}

function CollapseAll() {
	  var t = document.getElementById('info');
	  for (var i = 0; i < t.rows.length; i++) {
			if (t.rows[i].id != "control") {
				  t.rows[i].style.display = 'none';
				  t.rows[i].style.visibility = 'hidden';
			}
	  }
}
</script>

<!-- End Java script to expand menus -->




<table id="info"> <!-- Begin table for java menus -->

<!------- Begin Display Stable Packages ---------->
<tr id="control">
<td bgcolor="#007700" width="100%" id="block1" class="sectionOpen" onclick="ShowHide('StableTab')"><center><font color="#FFFFFF">Stable Packages</center></td>
</tr>
<tr id="StableTab">
<td width="100%">
<iframe src="stable.php" name="stableFrame" width="780" height="550">
</iframe>
</td>
</tr>
<!------- End Display Stable Packages ---------->


<!------- Begin Display of test site for iframe ---------->
<tr id="control">
<td width="100%" id="block2" class="sectionOpen" onclick="ShowHide('GTab')"><center>Google info</center></td>
</tr>
<tr id="GTab">
<td width="100%">
<iframe src="http://google.com" name="gInfoFrame" width="650" height="120">
</iframe>
</td>
</tr>
<!------- End Display of test site for iframe ---------->
</table>



Can someone give me some tips on how to accomplish what I'm looking for?
Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Need help with collapsing menu and iframes

#2 markhazlett9  Icon User is offline

  • Coding is a lifestyle
  • member icon

Reputation: 60
  • View blog
  • Posts: 1,666
  • Joined: 12-July 08

Re: Need help with collapsing menu and iframes

Posted 26 February 2009 - 02:10 PM

This should be in the javascript forum should it not?
Was This Post Helpful? 0
  • +
  • -

#3 jakev383  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 41
  • Joined: 27-May 08

Re: Need help with collapsing menu and iframes

Posted 26 February 2009 - 07:04 PM

Sorry - clicked the wrong forum. Can someone move it or should I repost?
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8315
  • View blog
  • Posts: 31,836
  • Joined: 06-March 08

Re: Need help with collapsing menu and iframes

Posted 26 February 2009 - 07:09 PM

View Postjakev383, on 26 Feb, 2009 - 06:04 PM, said:

Sorry - clicked the wrong forum. Can someone move it or should I repost?


I'll move it
Was This Post Helpful? 0
  • +
  • -

#5 jakev383  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 41
  • Joined: 27-May 08

Re: Need help with collapsing menu and iframes

Posted 01 March 2009 - 11:37 AM

Anyone even know any sites where I can get some examples on this topic?
Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1