Jump to content
  • 0

Плавное выпадающее меню


Ridento
 Share

Question

http://teacheri.ru/test/

Есть там такое меню


<div id="left">

<ul id="mfli"> <!-- Выпадающее меню -->
<li onClick="toggle_show('bla-bla2')"><a href="#home">Компании</a></li>
<ul id="bla-bla2">
<li><a href="#aboutCompany">Каталог</a></li>
<li><a href="#catalogue">Подбор</a></li>
<li><a href="#catalogue">Новые</a></li>
<li><a href="#catalogue">События</a></li>
<li><a href="#catalogue">Акции</a></li>
</ul>
<li><a href="">Рейтинг</a></li>
<li><a href="">Инструментарий</a></li>
<li><a href="">Услуги</a></li>
<li><a href="">Статьи и словарь</a></li>


<li><a href="">Компании</a></li>
</ul>
</div> <!-- End left -->

/* Левое меню */
ul#mfli {
margin-top: 12px;
}

#mfli li {
background: url(../i/mfli.png) 0 0 no-repeat;
width: 157px;
height: 39px;
margin-top: -15px;
text-align: center;
display: block;
position: relative;
z-index: 1;
-webkit-transition:background 0.33s ease;
-moz-transition:background 0.33s ease;
transition:background 0.33s ease;
}

#mfli li:hover {
background: url(../i/mflia.png) 0 0 no-repeat;
}

ul#bla-bla2 {
text-align: center;
display: none;
background: #f9efe7;
-webkit-border-bottom-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-moz-border-radius-bottomright: 8px;
-moz-border-radius-bottomleft: 8px;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
margin: 0 auto;
width: 130px;
position: relative;
z-index:2;
padding-top: 15px;
top: -9px;
margin-bottom: 10px;}

#bla-bla2 li {
height:27px;
width: 130px;
text-align: center;
background: none;
margin-top: -1px;
}

#bla-bla2 li:hover {
background: #fff;
}

ul#bla-bla2 li a{
width: 130px;
text-align: center;
background: none;
color: #dc143c;
}

#mfli li a {
font: 16px Arial;
text-decoration: none;
color: #fff;
line-height: 30px;
display: block;
}

Нужно организовать плавное выдвижение выпадающего меню, знаю что через js - но не получается...

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Для того, что должно "плавно выдвигаться", пишите функцию, которая принимает параметр положения "выдвигаемого", изменяет на небольшую величину, если не достигнуто конечное положение, то устанавливается таймер с вызовом этой же функции. Запуск функции организуется через событие типа onMouseOver, которое должно вешаться на контейнер соответствующий началу "плавно-выдвижения".

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