F
F
filippokk2015-11-14 18:03:36
css
filippokk, 2015-11-14 18:03:36

How to make a menu for a site similar to wildberries?

There is a site (local) that needs to be done so that when you hover over a menu item, it becomes active and remains active when the list of subcategories is displayed. To make it clearer, you need the same menu operation as on https://www.wildberries.ru/ I understand that this is js and the mouseover and mouseout properties, but I don’t know how to do it. Tell me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Finnish, 2015-11-14
@filippokk

I'm not making a discovery when I say this is done without JS, in pure CSS using :hover. More or less like this:

<span class="menu-item">
  О компании
  <div class="submenu">
    Основана вчера, продаём телефоны, звоните...
  </div>
</span>
<style>
  .menu-item > .submenu { display: none; }
  .menu-item:hover > .submenu { display: block; }
</style>

A
Alexander Taratin, 2015-11-14
@Taraflex

https://jsfiddle.net/QW01_01/q0yt211p/9/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question