Page 1 of 1

How to make my menu work good?!

Posted: Mon May 18, 2009 6:21 am
by lalalez
Hi everybody,

It's my first time here and I have a question for you guys:

I've created a header.php file (separatly) and I need to add code to this file, so that a little triangle appears in a menu, when a user clicks in its submenu.

Here is my code:

Code: Select all

<!DOCTYPE php PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<php xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/php; charset=utf-8" />
<title>My Company</title>
</head>
<body> 
<div id="header">
<div class="header-area">
<div class="header-content">
<div class="wrap">
<h1 class="logo"><a href="index.php">Company</a></h1>
<em>My Company</em>
<form action="">
<fieldset class="form">
<div>
<input class="text" type="text" value="search"/>
</div>
<input class="img" type="image" src="images/btn-go.gif"/>
</fieldset>
</form>
</div>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a class="MenuBarItemSubmenu" href="#">About us</a>
<ul>
<li><a href="overview.php">Overview</a></li>
<li><a href="partnerships.php">Partnerships</a></li>
</ul>
</li>
<li> <a style="background:url(images/icon-active.gif) no-repeat 50% 100%;" class="MenuBarItemSubmenu" href="#">SERVICES</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="services.php">Services</a></li>
<li><a href="it.php">IT</a></li>
<li><a href="1.php">Center</a></li>
</ul>
</li>
<li><a class="MenuBarItemSubmenu" href="#">TRAININGS</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="calendar.php">Calendar</a></li>
<li><a href="Training1.php">T1</a></li>
<li><a href="Training2.php">T2</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="MenuBarItemSubmenu" href="#">NEWS & EVENTS</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="calendar.php">Calendar</a></li>
<li><a href="news.php">Current News & Events</a></li>
<li><a href="archives.php">Archives</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</body>
</php>
 

Can anybody tell me which code should I add here (if statements...??) and where to put it in my code?

Thanks :)

Re: How to make my menu work good?!

Posted: Mon May 18, 2009 7:12 am
by jayshields
You'll need to use JavaScript and CSS. Start by looking at existing solutions and adapt them to fit your needs.

Search Google for things like hierarchical menu, sub menu, cascading menu, JavaScript menu, CSS menu, etc, etc.

Re: How to make my menu work good?!

Posted: Mon May 18, 2009 7:56 am
by lalalez
Well... I searched and didn't succeed to find the answer... That's why I posted here :(

Please, if somebody knows the answer... let me know immediately !


Thanks,
L

Re: How to make my menu work good?!

Posted: Mon May 18, 2009 8:01 am
by jayshields
No one is going to code it for you.

If you don't know anything about JavaScript or CSS I suggest you learn the basics of those two technologies first and then follow the advice I gave in my previous post - you could quite easily find an example on the Web which resembles what you want (even if you have to steal it from somewhere).

Re: How to make my menu work good?!

Posted: Mon May 18, 2009 10:11 am
by Benjamin
:arrow: Moved to Volunteer Work