a little problem with dhtml menu

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

a little problem with dhtml menu

Post by mudkicker »

Code: Select all

<script type="text/javascript">
/*  
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
function SwitchMenu(obj)&#123;
	if(document.getElementById)&#123;
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none")&#123;
			for (var i=0; i<ar.length; i++)&#123;
				ar&#1111;i].style.display = "none";
			&#125;
			el.style.display = "block";
		&#125;else&#123;
			el.style.display = "none";
		&#125;
	&#125;
&#125;
function ChangeClass(menu, newClass) &#123; 
	 if (document.getElementById) &#123; 
	 	document.getElementById(menu).className = newClass;
	 &#125; 
&#125; 
document.onselectstart = new Function("return false");
</script>
This is the script i am using. You can see it live at:
http://www.alltheteams.com/fark/urunler.php

what i want to do is i should click the main category link and it will go to its page and even in this page opens its sub-categories. i hope i could explain my problem. thanks.
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

well, i did a mousover thing. but even it works like i want in firefox but in stupid ie it doesn't work.
i use it now so:

Code: Select all

<li id="menu1" onmouseover="SwitchMenu('sub1')" style="cursor: pointer;"><a href="#" ondblclick="self.location='?k=1'">Kabin Sistemleri</a></li> 
											<div class="submenu" id="sub1" style="<?php show_submenu(1); ?>"> 
												<ul> 
													<li><a href="?s=1&k=1">Jumbo Model</a></li> 
													<li><a href="?s=2&k=1">Venüs Model</a></li> 
													<li><a href="?s=3&k=1">Klasik Model</a></li> 
													<li><a href="?s=4&k=1">Flax Model</a></li> 
													<li><a href="?s=5&k=1">Donnk  Model</a></li> 
												</ul> 
											</div>
Post Reply