FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Javascript collapsing view
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Javascript collapsing view [message #24135] Sat, 16 April 2005 18:56 Go to previous message
StingRay is currently offline  StingRay   Canada
Messages: 14
Registered: April 2005
Karma:
Junior Member
Did a search and didn't see this, so forgive if already discussed and dismissed.


The ability to collapse categories etc is great, but if possible I'd like to see the option to have this done via javascript so the page does not need to reload after expanding or collapsing.

More and more the benefits of mixing this kind of navigation are being used, just look at Google leading the way with their maps.


Here's an example to clarify what I mean.
<script language='JavaScript' type='text/javascript'>
	
		function ShowHide(id1, id2) {
			  if (id1 != '') expMenu(id1);
			  if (id2 != '') expMenu(id2);
		}
		
		function expMenu(id) {
			  var itm = null;
			  if (document.getElementById) {
				itm = document.getElementById(id);
			  } else if (document.all){
				itm = document.all[id];
			  } else if (document.layers){
				itm = document.layers[id];
			  }
			
			  if (!itm) {
			   // do nothing
			  }
			  else if (itm.style) {
				if (itm.style.display == 'none') { itm.style.display = ''; }
				else { itm.style.display = 'none'; }
			  }
			  else { itm.visibility = 'show'; }
		}
</script>


And usage

<a href="javascript:ShowHide('qr_open','qr_closed');" title='Contact us'>Contact Us</a>

<div id='qr_open'>
	<span style='position: absolute;top: 390px;left: 110px;'>
		<table border="0"style="width:40%" cellspacing="2" cellpadding="0">
			<tr>
				<td>
					<form action="/scripts/index.php" method="post" class="listitem">
					Name: <input type="text" name="name" value=""><br /><br />

					Email : <input type="text" name="email" value=""><br /><br />
					Message:<br />
					<textarea rows="2" cols="40" name="message"></textarea><br />
					<input type="submit" name="submit" value="Submit">
					<input type="hidden" name="sent" value="yes">
					<input type="hidden" name="action" value="check">
					</form>
				</td>

			</tr>
		</table>
	</span>
</div>

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Search Tree View
Next Topic: Is fudforum no longer GPL?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 03:47:32 GMT 2024

Total time taken to generate the page: 0.04196 seconds