Many times I saw a similar menu on the network, of course I did this myself, but:
- How to remove the name
ID
from the address bar - How to make the transition to anchors on
hover
- How to align other blocks like the
первый
Sandbox example: codepen
*{ margin:0; padding:0; list-style:none; text-decoration:none; } menu{ height:50px; background:#fff; line-height:47px; } ul li{ display:inline-block; padding:.1em 1em; background:#fff; position:relative; outline:1px solid #eee; } ul>li>a{ color:blue; } .l:after{ content:""; border:5px solid transparent; border-top:5px solid blue; position:absolute; right:2px; top:48%; } .l .menu{ position:absolute; top:51px; left:0; width:600px; height:300px; background:#fff; border:10px solid #fff; outline:1px solid #eee; display:none; } .l:hover .menu{ display:block; } .tab{ overflow:hidden; width:100%; height:100%; background:#fff; } .paginator,.content{ float:left; height:100%; } .paginator{ width:30%; background:#fff; } .content{ width:70%; background:#fff; position:relative; } .view{ width:95%; height:95%; outline:1px solid #eee; margin:1px 2%; overflow:hidden; } .paginator p{ border:1px solid #eee; margin:0 0 3px 0; padding-left:4px; } .paginator p:focus, .paginator p:hover{ background:#eee; } .paginator pa{ display:block; width:100%; height:100%; color:blue; } .view div{ width:90%; height:90%; margin:10px auto 30px; } .p1{ background:#ccc; } .p2{ background:#000; } .p3{ background:#cc0000; } .p4{ background:#30dd30; }
<menu> <ul> <li><a href="">Главная</a></li> <li><a href="">Гостевая</a></li> <li class="l"><a href="">Примеры</a> <div class="menu"> <div class="tab"> <div class="paginator"> <p><a href="#d">Изображения</a></p> <p><a href="#c">Смайлы</a></p> <p><a href="#b">Книги</a></p> <p><a href="#a">Кино</a></p> </div> <div class="content"> <div class="view"> <div id="d"class="p1"></div> <div id="c" class="p2"></div> <div id="b" class="p3"></div> <div id="a" class="p4"></div> </div> </div> </div> </div> </li> <li><a href="">О нас</a></li> </ul> </menu>
I naturally understand that the transitions to the anchor are not really id="?"
do hover
on css
but hover
not sure how I do it on js
, please explain how this is done and especially about the first item and the second ?