| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Drop Down Menu Help Please
#1
Posted 03 February 2009 - 02:53 AM
#2
Posted 03 February 2009 - 05:09 PM
#3
Posted 03 February 2009 - 05:25 PM
you can use adobe flash to make a abnormal flash menu or java script my personal because they come ready. This is the link for you to get a few
http://javascript-ar...drop_down_menu/
#4
Posted 03 February 2009 - 05:54 PM
#5
Posted 03 February 2009 - 11:00 PM
Veradesigns, on Feb 3 2009, 01:25 PM, said:
you can use adobe flash to make a abnormal flash menu or java script my personal because they come ready. This is the link for you to get a few
http://javascript-ar...drop_down_menu/
I have to make a separate CSS style sheet to do this right? I understand that the first part goes in the body, but the CSS I am still a little confused about.
#6
Posted 04 February 2009 - 02:30 AM
lonebyrd, on Feb 3 2009, 10:54 AM, said:
lonebyrd, on Feb 3 2009, 04:00 PM, said:
You said you already know HTML and CSS so you should be able to start out with this yourself:
1. Create your nav bar with the links that are going to call the drop down menus.
2. Create a few absolute-positioned div layers positioned under each of the links and fill them with the sub-menu items of your choice.
3. Give all those div layers their own unique ID using the ID attribute.
4. Set the style of all these div layers to be hidden, so they are not visible until you want them to be.
Now, after you do this you have a choice of which direction you want to go it. You can use CSS for basic drop-down menus, or if you decide to use javascript you can have a bit more control over these drop-down menus.(such as adding animation or fade in/out).
If you choose to use CSS add an class attribute to each of the links and use the :hover property to have the div layers to be visible.
For example:
<a href="#" class="stuff1">Stuff</a>
<div id="div1">Stuff1<br>Stuff2<br>Stuff3</div>
---- And in your head or another file:----
<style type="text/css">
.div1{display:none}
.stuff1:hover .div1{display:block;}
</style>
Now if you choose to use javascript you can use functions to show or hide the div layers using onMouseOver and onMouseOut:
<a href="#" onMouseOver="show()" onMouseOut="hide()">Stuff</a>
<div id="div1">Stuff1<br>Stuff2<br>Stuff3</div>
---- And in your head or another file:----
<script type="text/javascript">
function show(){
document.getElementById("div1").style.display="block";
}
function hide(){
document.getElementById("div1").style.display="none";
}
</script>
Now if you do decide to go with javascript and you are going to have multiple drop down menus you probably want to pass something to the function so javascript knows which submenu to display like this:
<a href="#" onMouseOver="show(1)" onMouseOut="hide(1)">Stuff</a> <a href="#" onMouseOver="show(2)" onMouseOut="hide(2)">Other</a>
<div id="div1">Stuff1<br>Stuff2<br>Stuff3</div><div id="div2">Other1<br>Other2<br>Other3</div>
---- And in your head or another file:----
<script type="text/javascript">
function show(i){
document.getElementById("div"+i).style.display="block";
}
function hide(i){
document.getElementById("div"+i).style.display="none";
}
</script>
Let me know if you have any questions or want me to explain something in greater detail.
#7
Posted 04 February 2009 - 03:21 AM
#8
Posted 18 February 2010 - 09:40 AM
The html file is :
<div id="header"> <div class="logo">NorthStar-EHS<br /><div class="sub">Environment Solutions</div></div> <div class="menu"> <ul> <li><a href="#"><div class="links">About Us</div></a></li> <li><a href="#"><div class="links">Services</div></a></li> <li><a href="#"><div class="links">Products</div></a></li> <li><a href="#"><div class="links">Enquiry</div></a></li> <li><a href="#"><div class="links">Contact Us</div></a></li> </ul> </div></div>
The css used is :
#header{Background:url(images/menu_bg.Jpg) repeat-x;Height:56px;Width:910px;Margin:0 auto;}.Logo{Font-family:Georgia, "Times New Roman", Times, serif;Font-size:30px;Padding-top:3px;Padding-left:5px;Width:280px;Color:#FFFFFF;Float:left;}.Sub{Font-family:Verdana, Arial, Helvetica, sans-serif;Font-size:12px;Width:280px;Color:#FFFFFF;Text-align:right;}.Menu{Width:620px;Float:right;}.Menu ul{List-style-type:none;Margin:0px;Padding:0px;Width:620px;Text-align:right;}.Menu ul li{Float:left;Display:block;Width:120px;Border-left:solid 1px #1a3857;}.Menu ul li a{Display:block;Text-align:center;Color:#CCCCCC;Font-family:Verdana, Arial, Helvetica, sans-serif;Text-decoration:none;Font-weight:bold;Font-size:13px;Height:56px;}.Menu ul li a:hover{Color:#FFFFFF;Height:56px;Background:url(images/menu_over.Jpg) repeat-x;}.Links{Padding-top: 17px;}
I need 7 drop links under Services Link. Please help by code. The menu style should not be changed. To see it in working condition please browse :
http://www.Crazywebo...nment/index.Php
Drop menu should be under services link. Please help if u can.
Anil
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users















