Курсор вблизи обнаружения объектаCSS

Разбираемся в CSS
Ответить
Гость
 Курсор вблизи обнаружения объекта

Сообщение Гость »


I have the following html:

Код: Выделить всё

#menu-container
{
width: 100%;
height: 40px;
// used to detect hover
}

.menu
{
border: 1px solid black;
width: 300px;
height: 20px;

margin-top: -100px; // hidden
}

.menu-visible
{
margin-top: 0px; // visible
}



$("#menu-container").mouseenter(
function()
{
$(".menu").toggleClass('menu-visible');
}
);





The menu-wrapper's height is +20px, that's the extra space I'm 'detecting' the motion on.

Goal: Menu has to show up when cursor is near the menu (not over it).

Problem: Everything is working great, except I can't click/interact with the content that is under the menu-container (the extra 20px space).

Any suggestions? Thanks!


Источник: https://stackoverflow.com/questions/287 ... -detection
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «CSS»