Click to See Complete Forum and Search --> : Rollover Drop Right Menu (Right)


lightprism
02-14-2003, 01:47 PM
HELP!!! I have been slowly teaching myself javascript and html for the past couple of years, and I'm finally getting somewhere! (I think)

What I need help with is a Rollover drop down menu that instead of dropping straight down on a mouseover will open a menu to the right of the text. I don't know if this is possible at this point, but I figure someones got to have it. I have searched far and wide for this script and can't find what I am looking for, even from the javascript source. Any Javascript gurus out there? There is a damsel in distress!!!:o

mawood
02-14-2003, 01:55 PM
This is about as close as you can get - I think. Play with the positioning on this one:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My Drop Down Menu</title>




<script>
function mwDropit(mySelect,fake,real){
if (document.getElementById) {
t1=document.getElementById(fake);
t2=document.getElementById(real);
t1.options[0].text=mySelect.options[mySelect.selectedIndex].text;
t1.options[0].value=mySelect.options[mySelect.selectedIndex].value;
t2.style.visibility='hidden';
}

}
function mwBlur(real){
if (document.getElementById) {
t=document.getElementById(real);t.style.visibility='hidden';
}
}
</script>
</head>

<body>

<h3>Drop down width</h3>

<table bgcolor="#6AB5FF" width="550"><tr><td>Spacerspacerspacerspacerspacerspacer?:</td><td>
<form action="dropdown_width.html">






<!- Normal menu 1 ->


<select name="firstnormalmenu">
<option value="1">Please Select One:</option>
<option value="1">A Normal Menu</option>
<option value="2">to show this is</option>
<option value="3">not effected by</option>
<option value="4">the drop down</option>
<option value="5">bug in MSIE.</option>
</select>
<br>






<!- Magic menu 2 for IE(NS6) browser ->



<div id="real_1" style="position:relative; top:20px; left:-170px; visibility: hidden;"><div id="dummy" style="position:absolute;">
<select size="5" onClick="mwDropit(this,'fake_1','real_1')" onBlur="mwBlur('real_1')">
<option>Please Select One:
<option value="b">2 This is a dynamic menu. Its not really here. Yes, it holds its value for proper form submission.
<option value="c">3
<option value="d">4
<option value="e">55555555555555555555555555555555555555555555555555
<option value="f">6
<option value="g">7
<option value="h">8
<option>9
<option>10

</select>
</div></div>


<select id="fake_1" SELECTED style="width:141px;" onFocus="t=document.getElementById('real_1'); t.style.visibility='visible';body.focus();return false;" name="seconddynamicmenu">
<option>Please Select One:
</select>
<br>






<!- Normal menu 3 ->



<select name="thirdnormalmenu">
<option value="1">Please Select One:</option>
<option value="2">A Normal Menu</option>
<option value="3">xxxx</option>
<option value="4">ccccccccc</option>
</select>
<br>







<!- Magic menu 4 with controller for Netscape4 - for pages viewed by all browsers ->


<script>

if (document.getElementById) {

document.write("<div id=real_2 style=\"position:relative; top:20px; top:20px; left:-170px; visibility: hidden;\"><div id=\"dummy\" style=\"position:absolute;\"> ");
document.write("<select size=\"14\" onClick=\"mwDropit(this,'fake_2','real_2')\" onBlur=\"mwBlur('real_2')\"> ");
document.write("<option>Please Select One:");
document.write("<option>1 This is a Dynamic Menu. I am either the smartest hillbilly or I am just making this sentence long.");
document.write("<option>2 This one set to show more rows.");
document.write("<option>3");
document.write("<option> 5555555555555555555555555555555555555(What happened to 4?)");
document.write("<option>6 ");
document.write("<option>7 ");
document.write("<option>8 ");
document.write("<option>9 ");
document.write("<option>10 ");
document.write("<option>11");
document.write("<option>12");
document.write("<option>13");
document.write("<option>14");
document.write("<option>15");
document.write("<option>16");
document.write("<option>17");
document.write("<option>18");
document.write("<option>19");
document.write("<option>20");
document.write("<option>21");
document.write("<option>22");
document.write("<option>23");
document.write("</select> ");
document.write("</div></div> ");
document.write("");
document.write("<select id=\"fake_2\" SELECTED style=\"width:300px;\" onFocus=\"t=document.getElementById('real_2'); t.style.visibility='visible';body.focus();return false;\" name=\"fourthdynamicmenu\">");
document.write("<option>Please Select One:");
document.write("</select> ");
document.write("");

} else {

document.write("<select id=fake_2 name=fourthdynamicmenu>");
document.write("<option>Please Select One:");
document.write("<option>1 This is a Dynamic Menu. I am either the smartest hillbilly or I am just making this sentence long.");
document.write("<option>2 This one set to show more rows.");
document.write("<option>3");
document.write("<option> 5555555555555555555555555555555555555(What happened to 4?)");
document.write("<option>6 ");
document.write("<option>7 ");
document.write("<option>8 ");
document.write("<option>9 ");
document.write("<option>10 ");
document.write("<option>11");
document.write("<option>12");
document.write("<option>13");
document.write("<option>14");
document.write("<option>15");
document.write("<option>16");
document.write("<option>17");
document.write("<option>18");
document.write("<option>19");
document.write("<option>20");
document.write("<option>21");
document.write("<option>22");
document.write("<option>23");
document.write("</select> ");

}


</script>







<br><br>
<input type="submit">

</form>
</td></tr></table>
</body>
</html>

lightprism
02-14-2003, 02:07 PM
Okay so maybe I am looking for a cascading menu. Not a drop down. CASCADING MENU ANYONE?

Thanks for trying, but not exactly what I was looking for

2muchtime
02-18-2003, 03:30 AM
hey mawood, is it possible to do that menu with text, and hovers? Well, I know it is, but what would that look like, and would it still be browser compatible?