Solved

Drop down menu

Posted on 2002-03-25
8
317 Views
Last Modified: 2010-04-09
I have a simple drop down menu and an image for the go button.  For some reasons, the row ends up higher than what it should be and the button is higher than the menu itself.  I even tried setting the height of the <tr> but didn't work.  The form works fine but the alignment doesn't. Here is a sample code for it..

<form name="jump">
<script>
function jumpMenu(){location=document.jump.menu.options[document.jump.menu.selectedIndex].value;
}
</script>
<select name="menu">
<option value="http://www.toronto.edu/" selected>UofT</option>
<option value="http://www.ryerson.edu/">URyerson</option>
<option value="http://www.york.edu">YorkU</option>
</select>
<a href="Javascript:jumpMenu()"><IMG SRC="go.gif" border=0 width="22" height="22"></a>
</form>
0
Comment
Question by:qudoos
8 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 100 total points
ID: 6895017
set the align in the image tag:

<a href="#" onClick="jumpMenu(); return false;"><IMG SRC="go.gif" border="0" width="22" height="22" align="top"></a>


... or you might try align="bottom" , I don't remember which one
0
 
LVL 18

Expert Comment

by:bruno
ID: 6895021
you most likely need to set alignment on the image...

check here for the proper values for that attribute, and try a few until it works.

http://www.blooberry.com/indexdot/html/tagpages/i/image.htm#attrib



BRUNO
0
 
LVL 18

Expert Comment

by:bruno
ID: 6895025
sorry, knight, your comment wasn't there when i started posting.


gudoos, make sure you check what the alignment looks like in any browser you need it to work in.  while one value might look ok in one browser, might not look good in another.  make sure to try them all...sometimes things like "baseline" or "textop" or "absmiddle" work well as well.


BRUNO
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6895103
Try:

<IMG SRC="go.gif" style="float:right" border=0 width="22" height="22">

Cd&
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:lexxwern
ID: 6895664
or you can position the image as and where you want,

some ppl may not want to do this, but it still is a solution


<IMG SRC="go.gif" style="position:absolute;top:10px;left:10px" border=0 width="22" height="22">
for more css http://www.w3.org/

lexxwern
0
 
LVL 3

Expert Comment

by:winningl
ID: 6896817

place a <table> there to format the form display.


*****************************

<form name="jump">
<table>
<script>
function jumpMenu(){location=document.jump.menu.options[document.jump.menu.selectedIndex].value;
}
</script>
<tr><td>
<select name="menu">
<option value="http://www.toronto.edu/" selected>UofT</option>
<option value="http://www.ryerson.edu/">URyerson</option>
<option value="http://www.york.edu">YorkU</option>
</select></td>

<td>
<a href="Javascript:jumpMenu()"><IMG SRC="go.gif" border=0 width="22" height="22"></a></td>

</tr></table>
</form>

winningl
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6897029
You may also want to try resizing your image to match the line height...

try 10 or 12 pixels high for your image height

JimS
0
 
LVL 1

Author Comment

by:qudoos
ID: 6897154
Works perfectly!! Thank you.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now