PDA

View Full Version : Creating a drop down menu?


Spreegem
01-04-04, 12:50 PM
How would I create a drop down menu that automatically drops down, and has a black back ground? I am newbie to this but would like to learn how to. I may use flash to make a drop down menu, but would like to see if there are other ways first.

jayhawk
01-04-04, 01:08 PM
How would I create a drop down menu that automatically drops down, and has a black back ground? I am newbie to this but would like to learn how to. I may use flash to make a drop down menu, but would like to see if there are other ways first.

You can create a drop down menu using Javascript. Check this out as well: http://javascript.internet.com/generators/drop-down-menu.html

Spreegem
01-04-04, 01:25 PM
Yes. . . but I was more looking for being able to customise my menu, have a black background with orange hyperlinks or soemthing like that. Could that be done with Javascript or HTML, or would I have to use flash if I wanted to do something like that?

jayhawk
01-04-04, 07:20 PM
Yes. . . but I was more looking for being able to customise my menu, have a black background with orange hyperlinks or soemthing like that. Could that be done with Javascript or HTML, or would I have to use flash if I wanted to do something like that?

You can do that with JavaScript and HTML. For example:

<select name="menu" size="1" style="background-color:#000000" onChange="Your javascript function">
<option value="http://yoursite.com">yoursite.com</option>
<option value="http://yoursite2.com">yoursite2.com</option>
<option value="http://yoursite3.com">yoursite3.com</option>
</select>


The above code will produce a drop down with a black background. You will have to build a function in Javascript that redirects the user to the website that they choose in the drop down. As far as the orange hyperlinks go, you can use CSS.

Hope this helps.

gwx
01-05-04, 05:36 AM
You use what is called DHTML, a combo of HTML, CSS and Javascript. Go read it up.

delerium
01-17-04, 02:29 PM
if you want something that really catches the eye, use SMIL. you can embed it into the html. nothing needs to be downloaded by the user to run it. as far as i know, IE 5 and above support this. it will give you a very smooth transition. i will give you an example (this example is long and can be confusing since i stripped out a great deal of the code not pertaining to this question. It took me several days to develop this, so if your gonna use it for money...give a shout out to me lol)
<!----all images, design, layout, and source code created by delerium----->
<html xmlns:smil="urn:schemas-microsoft-com:time">
<style>
.time{ behavior: url(#default#time2);}
smil\:* { behavior:url(#default#time2)}
time:* { behavior:url(#default#time2)}
body { background-color:black;color:white;font-family:verdana;font-size:10pt; }

</style>
</head>

<body>

<!-------------------------this begins the navigation bar---------->
<!---test--->
<DIV STYLE="position:absolute; top:65; right:0;">
<smil:par begin="test.click" end="test1.click;test2.click;end.click;" >
<smil:animateMotion begin="0" dur="1" targetElement="test1"
values="0,0;0,75" fill="hold"/>
<smil:animateMotion begin="0" dur="1" targetElement="test2"
values="0,0;0,75" fill="hold"/>
<smil:animateMotion begin="0" dur="1" targetElement="end"
values="0,0;0,75" fill="hold"/>
</smil:par>
<div style="position:relative;top:65;right:0;width:0"id="test" >
<img src="gif/test.gif" width="128" height="79"></a>
</div>
</div>

<!---test1---->
<DIV STYLE="position:absolute; top:144; right:0; ">
<smil:par begin="test1.click" end="test.click;test2.click;end.click" >
<smil:animateMotion begin="0" dur="1" targetElement="test2"
values="0,0;0,100" fill="hold" />
<smil:animateMotion begin="0" dur="1" targetElement="end"
values="0,0;0,100" fill="hold" />
</smil:par>
<div style="position:relative;top:65;right:0;width:0"id="test1">
<img src="gif/test2.gif" width="128" height="79" >
</div>
</div>
<!----------this begins the drop down inside part------------>

<!----drop down for test--->
<DIV STYLE="position:absolute; top:210; right:0; z-index:-2;">
<div CLASS=time end="test1.click;test2.click;test3.click" begin="test.click" style="width:100;height:75;
filter:progid:DXImageTransform.Microsoft.Gradient( GradientType=1, StartColorStr=black, EndColorStr=#333399);font-size:12pt;">
<font color="white" >

<div id="hide" ONCLICK="loadomniaFrame()" onmouseover="this.style.color='#0099FF'" onmouseout=" this.style.background='', this.style.color=''">
<b STYLE="cursor: default"> Choice 1 </b>
</div>
<div id="hide1" ONCLICK="loadmuntarFrame()" onmouseover="this.style.color='#0099FF'" onmouseout=" this.style.background='', this.style.color=''">
<b STYLE="cursor: default">choice 2</b>
</div>
<div id="hide12" ONCLICK="loadexFrame()" onmouseover="this.style.color='#0099FF'" onmouseout="this.style.background='', this.style.color=''">
<b STYLE="cursor: default">choice 3 </b>
</div>
</font>
</div>
</div>
<DIV ID="overlay" STYLE="position:absolute; visibility:hidden; top:212; right:100;">
<IMG SRC="gif/bally.gif" width="15" height="15" >
</DIV>
<DIV ID="overlay1" STYLE="position:absolute; visibility:hidden; top:230; right:100;">
<IMG SRC="gif/bally.gif" width="15" height="15" >
</DIV>
<DIV ID="overlay12" STYLE="position:absolute; visibility:hidden; top:255; right:100;">
<IMG SRC="gif/bally.gif" width="15" height="15" >
</DIV>
</body>
</html>
----------------------------------------------------
sorry, i meant to post this under your thread but some how posted it as a new thread.
also, you will need to supply your own images. if you have any problems with this, let me know. in this example im using filters to make the background a fade too, you can just change the hex value to be black.
another way is to use styles. its not as impressive but does work. goto www.webmonkey.com for a tutorial on that. hope you like
--delerium

dwoody
07-29-04, 11:06 AM
Here is a menu with orange text and a black background. You can customize it furthur with Style Sheets. Theres also a function included that takes the page to the location specified in the value of the selct options.


<html>
<script>

function goThere()
{
if(window.document.menuform.menu.selectedIndex!=0)
{
window.location = window.document.menuform.menu.options[window.document.menuform.menu.selectedIndex].value
}
}

</script>
<form name="menuform" id="menuform">
<select name="menu" id="menu" size="1" style="background-color:#000000; color:#FF9900;" onChange="goThere()">
<option value="#">- - Select an Option - -</option>
<option value="http://www.tsn.com">TSN</option>
<option value="http://www.hotscripts.com">Hot Scripts</option>
</select>
</form>


<html>

vivichie
08-27-04, 01:13 AM
U can use dreamweaver to create drop down menus.. customize ur own colour, own font, anything.. and the javascript codes will be generated for you by dreamweaver.. :)

jamslam
08-31-04, 12:40 AM
@delerium, that is IE only. It won't work in any other browser...

You cannot create a drop down menu without neglecting some of your users, thusly making whatever is in your drop down menu inaccessible.

The best that I have come up with is a drop down menu driven on CSS, which allows it to work in all browsers, except for MSIE. However, in MSIE I created a .htc file (HTML Component) that will emulate the ':hover' in CSS...

http://www.webtrickscentral.com/stuff/CSS/CSS_dropdown.html

And the HTC file (make sure 'behavior: url(the HTC file);') points to the propwer location...

http://jamslam.zyns.com/moz.htc

Very each to change via stylesheet.. easily customizable. No need to credit me either.