By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,394 Members | 1,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,394 IT Pros & Developers. It's quick & easy.

dropdown menu over text 2 / to see the behavior ...

P: n/a
I would like for users to be able to select from a small number of options
that come from a little drop down menu which then closes.
..
http://www.geocities.com/jweinberg19...on_text00.html
..
In order to see the behavior you should "mouseover" the white-on-black text
segment that says "omnis dolor repellend"
..
the thing is that I don't want for the whole space in the paragraph to be
empty. I just need for the little menu to show and then go away without
disturbing the text and/or other HTML around it
..
After the user makes a selection it should just nicely close.
..
Also I can't figure out how to make the menu close if the user does not
make an selection for a period of time
..
how could you do this?
..
Thanks
jw
Mar 28 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
jw***********@yahoo.com wrote:
I would like for users to be able to select from a small number of options
that come from a little drop down menu which then closes.
.
http://www.geocities.com/jweinberg19...on_text00.html
.
In order to see the behavior you should "mouseover" the white-on-black text
segment that says "omnis dolor repellend"
.
the thing is that I don't want for the whole space in the paragraph to be
empty. I just need for the little menu to show and then go away without
disturbing the text and/or other HTML around it
.
After the user makes a selection it should just nicely close.
.
Also I can't figure out how to make the menu close if the user does not
make an selection for a period of time


<html>
<head>

<style type="text/css" media="all">

body, td {
font-family: Verdana;
font-size: 14px;
margin: 10px;
}

#omnis {
color: white;
background-color: black;
}

..vis {
visibility: visible;
display: block;
background-color: white;
z-index: 1;
position: absolute;
/* what are top and left screen positions */
/* where radios should be displayed on screen */
top: 65px;
left: 150px;
}

..invis {
visibility: hidden;
display: none;
}

</style>

<script language="javascript" type="text/javascript">

// how long radios remain visible after onMouseover ?
var seconds_onMouseover = 10

// how long radios remain visible after selection is made ?
var seconds_selection = 0.5

function show_Radios() {
mytable.className='vis'
setTimeout("mytable.className='invis'",
seconds_onMouseover * 1000)
}

function hide_Radios(choice) {
alert('you chose: ' + choice)
setTimeout("mytable.className='invis'",
seconds_selection * 1000)
}
</script>

</head>

<body bgcolor="silver">

<p>text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text <span id="omnis" onMouseOver="show_Radios();">
omnis dolor repellend</span> text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text<br>
text text text text text text text text text text text text
</p>

<table id="mytable" class="invis">
<tr>
<td>
<form>
<input type="radio" name="op2" checked
onclick="javascript:hide_Radios(0)">all news<br/>
<input type="radio" name="op2"
onclick="javascript:hide_Radios(1)">selected<br/>
<input type="radio" name="op2"
onclick="javascript:hide_Radios(2)">not selected
</form>
</td>
</tr>
</table>

</body>
</html>

--
Bart

Mar 28 '06 #2

P: n/a
Hi,

while trying out your code I noticed firefox was thowing lots of:

"Warning: Element referenced by ID/NAME in the global scope. Use W3C
standard document.getElementById() instead."

errors at me.

I tried to quickly find a way to rid this warning, but could not. Nor
do I exactly know what this especific error mean.

How do you rid it?

otf

Apr 4 '06 #3

P: n/a
onetitfemme wrote:
while trying out your code I noticed firefox was thowing lots of:

"Warning: Element referenced by ID/NAME in the global scope. Use W3C
standard document.getElementById() instead."

errors at me.
Actually, it is "but" a warning, nothing that stops the script from
executing. But you should take it seriously, as it shows that your
code is error-prone.
I tried to quickly find a way to rid this warning, but could not. Nor
do I exactly know what this especific error mean.
You tried

foo

to refer to an element with ID or name "foo".
How do you rid it?


document.getElementById("foo")

if "foo" is the ID of the element.

document.getElementsByName("foo")[0]
or ....elements["foo"]

if "foo" is the name of the element (the second is recommended for form
controls).

Be sure to do proper runtime feature tests before you call either method
or access the object.

<URL:http://pointedears.de/scripts/test/whatami#inference>
PointedEars
Apr 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.