/    Sign up×
Community /Pin to ProfileBookmark

Dropdown menu dosnt disappears when mouse moves off

I have made a dropdown menu with following code:
….

<TABLE BORDER=”0″>

<TD VALIGN=”top” Width=”160″>

<SPAN onMouseOver=”document.all.menu1.style.display =’block'”onMouseOut=”document.all.menu1.style.display = ‘block'”>
<img src=”http://static1.squarespace.com/static/536c9877e4b0e67f79672fa8/t/551276e3e4b01a4db1df8786/1401265033133/Screen+Shot+2014-05-28+at+10.16.57+AM.png?format=300w“; height=”180″ width=”270”> <BR>

</SPAN>

<SPAN ID=”menu1″ onClick=”document.all.menu1.style.display = ‘none'”>

<A HREF=”link”>name</A><BR>
<A HREF=”link”>name</A><BR>
<A HREF=”link”>name</A><BR>
<A HREF=”link”>name</A><BR>
<A HREF=”link”>name</A>

</SPAN>

</TD>
</TABLE>
….

and my css for it is:

#menu1 { display : none }
#menu2 { display : none }
#menu3 { display : none }

A:link {color:black; text-decoration:none}
A:hover {color:blue; text-decoration:underline}
nav a {padding: 20px;}

but the mouse doesnt disappear when I move away from the menu.
Someone that can help?

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulMar 29.2015 — You have omitted <tr> </tr> (though I wonder why the table is there anyway?).

Your code says [b]onMouseOut="document.all.menu1.style.display = '[color="red"]block[/color]'"[/b]. Also the <span> does not encompass the menu, so I'm not sure it will work anyway.

Why do you have the <span> onClick as well?
Copy linkTweet thisAlerts:
@dp8Mar 30.2015 — I dont understand why are you using JS code and spans.

I hope following link will help you.

http://cssdeck.com/labs/another-simple-css3-dropdown-menu
Copy linkTweet thisAlerts:
@ramarjunApr 02.2015 — not need js on dropdown menu its simple to create while using css
Copy linkTweet thisAlerts:
@dp8Apr 04.2015 — Then follow this link. it will help. i am sure

http://line25.com/tutorials/how-to-create-a-pure-css-dropdown-menu
×

Success!

Help @Mahdiye_na spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...