Jump to content
  • 0

Вертикальное выпадающее меню


Angela
 Share

Question

Здравствуйте уважаемые мужчины!

Подскажите пожалуйста, что нужно добавить, чтобы меню оставалось когда курсор убирается с кнопки :lol:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Идентификаторы</title>
<style type="text/css">
#descr {
position: relative; /* Относительное позиционирование */
visibility: hidden; /* Прячем содержимое слоя */
width: 150px;
}
#navi {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#navi a {
display: block;
text-decoration: none;
font-size: 14px;
font-family: Arial, Helvetica;
color: #000099;
padding: 3px;
margin-top: 0px;
border-bottom: 1px dashed #cccccc;
width: 150px;
}
#navi a:hover {
color: #000;
background-color: #99CCFF;
margin: 0px;
}
#navi li {
display: inline;
}
</style>
<script type="text/javascript">
function hiddenLayer() {
document.getElementById("descr").style.visibility = "hidden";
}
function showLayer() {
document.getElementById("descr").style.visibility = "visible";
}
</script>
</head>
<body>
<a href="#" onMouseOver="showLayer()" onMouseOut="hiddenLayer()">
<img src="button.gif" width="98" height="33" border="0" alt="Кнопка"></a>
<div id="descr">
<ul id="navi">
<li id="navi"><a href="#" id="navi">Первый пункт</a></li>
<li id="navi"><a href="#" id="navi">Второй пункт</a></li>
<li id="navi"><a href="#" id="navi">Третий пункт</a></li>
</ul>
</div>

</body>
</html>

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Идентификаторы</title>
<style type="text/css">
#descr {
position: relative; /* Относительное позиционирование */
visibility: hidden; /* Прячем содержимое слоя */
width: 150px;
}
#navi {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#navi a {
display: block;
text-decoration: none;
font-size: 14px;
font-family: Arial, Helvetica;
color: #000099;
padding: 3px;
margin-top: 0px;
border-bottom: 1px dashed #cccccc;
width: 150px;
}
#navi a:hover {
color: #000;
background-color: #99CCFF;
margin: 0px;
}
#navi li {
display: inline;
}
</style>
<script type="text/javascript">
function hiddenLayer() {
document.getElementById("descr").style.visibility = "hidden";
}
function showLayer() {
document.getElementById("descr").style.visibility = "visible";
}
</script>
</head>
<body>
<a href="#" onMouseOver="showLayer()" onClick="hiddenLayer()">
<img src="button.gif" width="98" height="33" border="0" alt="Кнопка"></a>
<div id="descr">
<ul id="navi">
<li id="navi"><a href="#" id="navi">Первый пункт</a></li>
<li id="navi"><a href="#" id="navi">Второй пункт</a></li>
<li id="navi"><a href="#" id="navi">Третий пункт</a></li>
</ul>
</div>

</body>
</html>

меню закроется при щелчке.

но это не очень удобно

Link to comment
Share on other sites

  • 0
может setTimeout(); или onblur?

Victor, а куда time out() ? :huh:

=PSU=, Подходит вполне, только другие кнопки "поехали" :)

Вот:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Nav</title>
<style type="text/css">
#descr {
position: relative; /* Относительное позиционирование */
visibility: hidden; /* Прячем содержимое слоя */
width: 150px;
clear: both;
}
#navi {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#navi a {
display: block;
text-decoration: none;
font-size: 14px;
font-family: Arial, Helvetica;
color: #000099;
padding: 3px;
margin-top: 0px;
border-bottom: 1px dashed #cccccc;
width: 150px;
}
#navi a:hover {
color: #000;
background-color: #99CCFF;
margin: 0px;
}
#navi li {
display: inline;
}
</style>
<script type="text/javascript">
function hiddenLayer() {
document.getElementById("descr").style.visibility = "hidden";
}
function showLayer() {
document.getElementById("descr").style.visibility = "visible";
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="#" onMouseOver="showLayer()" onClick="hiddenLayer()"><img src="images/navbar_01.gif" width="125" height="30" alt=""></a><div id="descr">
<ul id="navi">
<li id="navi"><a href="#" id="navi">Первый пункт</a></li>
<li id="navi"><a href="#" id="navi">Второй пункт</a></li>
<li id="navi"><a href="#" id="navi">Третий пункт</a></li>
</ul>
</div></td>
<td>
<img src="images/navbar_02.gif" width="125" height="30" alt=""></td>
<td>
<img src="images/navbar_03.gif" width="125" height="30" alt=""></td>
<td>
<img src="images/navbar_04.gif" width="125" height="30" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>

Что тут использовать? z-index или float? или вообще не то ни другое :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy