Jump to content
  • 0

Помогите доработать css меню


xtr
 Share

Question

День добрый помогите доработать css Меню, что то у меня ничего не получается...

Сам код стандартный:

<ul id="topnav">
<li><a href="#">Меню 1</a></li>
<li>
<a href="#">Меню 2</a>
<!--Здесь начинается подменю-->
<span>
<a href="#">Подменю 1</a>
<a href="#">Подменю 2</a>
<a href="#">Подменю 3</a>
</span>
<!--Заканчивается подменю-->
</li>
<li><a href="#">Меню 3</a></li>
</ul>

CSS

ul#topnav {
margin: 0; padding: 0;
float: left;
width: 970px;
list-style: none;
position: relative;
font-size: 1.2em;
background: url(topnav_stretch.gif) repeat-x;
}
ul#topnav li {
float: left;
margin: 0; padding: 0;
border-right: 1px solid #555;
}
ul#topnav li a {
padding: 10px 15px;
display: block;
color: #f0f0f0;
text-decoration: none;
}
ul#topnav li:hover { background: #1376c9 url(topnav_active.gif) repeat-x; }

ul#topnav li span {
float: left;
padding: 15px 0;
position: absolute;
left: 0; top:35px;
display: none;
width: 970px;
background: #1376c9;
color: #fff;
/*--Bottom right rounded corner--*/
-moz-border-radius-bottomright: 5px;
-khtml-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
/*--Bottom left rounded corner--*/
-moz-border-radius-bottomleft: 5px;
-khtml-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
}
ul#topnav li:hover span { display: block; }
ul#topnav li span a { display: inline; }
ul#topnav li span a:hover {text-decoration: underline;}

Скрипт

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

инициирующий скрипт

<script type="text/javascript">
$(document).ready(function() {
$("ul#topnav li").hover(function() {
$(this).css({ 'background' : '#1376c9 url(topnav_active.gif) repeat-x'});
$(this).find("span").show();
} , function() { //on hover out...
$(this).css({ 'background' : 'none'});
$(this).find("span").hide();
});
});
</script>

Нужно чтобы в подменю выпадало ещё одно меню столбиком (вертикально)

Помогите всю голову сломал как сделать

Да совсем забыл написать: тут можно посмотреть в действии http://mix-up.ru/demo/horizontal-dropdown-submenu/

Edited by xtr
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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