javascript - js sliding menu help -- animation delay in the middle? -


i'm looking make menu has kind of specific functions. i'm relatively new javascript , jquery have no idea start. here want do:

js problem

hovering on link 4 , 5 continue make them stay in end-animation state.

any suggestions? tried doing css3 animations can't pause after user stops hovering on link 3 before sliding back. ran issue of gap between link 3 , link 4 causing hover stop. javascript seems better choice.

jsfiddle of css3 animations

this relevant code has css3 animations in it:

 -webkit-transition: .2s ease 0s;  -moz-transition: .2s ease 0s;  -o-transition: .2s ease 0s;  -ms-transition: .2s ease 0s;  transition: .2s ease 0s; 

edit: i've updated jsfiddle of current css3 animation (it looks bit different in live preview on jsfiddle on website).

the third 'li' of top menu has been extended in width when moving cursor on 'extralinks' menu, latter doesn't slide out of view.

pure css solution: jsfiddle link

css:

* {     padding:0;     margin:0; } .links {     width:100%; }  .links > menu {     left: 0%;     text-align:center;     position: fixed;     z-index: 4; }  .links menu li  {     whitespace: nowrap;     display: inline-block;     margin-right: 30px;     position: relative;     padding: 0;     height: 40px;     top: 24px;     z-index: 4;     float:left; }  .links a, a:visited {     font-family: robotolight;     text-decoration: none;     text-transformation: none;     weight: normal;     font-size: 18px;     color: #000000;     z-index: 4;     float:left;     height: 100%; }  .links a:hover {     font-family: robotolight;     text-decoration: none;     text-transformation: none;     weight: normal;     font-size: 18px;     color: #33b5e5;     z-index: 4; }  .l3 .extralinks {     white-space: nowrap;     position: fixed;     top: 0px;     left:100%;     padding: 0 0 0 10px;     text-align:center;     height: 40px;     width: 300px;     z-index: 4;     display: inline-block;     -webkit-transition: .2s ease 0s;     -moz-transition: .2s ease 0s;     -o-transition: .2s ease 0s;     -ms-transition: .2s ease 0s;     transition: .2s ease 0s;     z-index: 4; } .l3:hover .extralinks {     left: 50%;     } .l3:hover .extralinks li { }   .links li:nth-child(3) {     width:200px;     margin-right:0px; }  .links li:nth-child(3):hover > {     font-family: robotolight;     text-decoration: none;     text-transformation: none;     weight: normal;     font-size: 18px;     color: #33b5e5;     z-index: 4;                     border-bottom: 3px solid #33b5e5; }   .links li:hover > a, li:active > {     border-bottom: 3px solid #33b5e5; }   

html:

<div class="links">     <menu>         <li>             <a href="#">link 1</a>         </li>         <li>             <a href="#">link 2</a>         </li>         <li class="l3">             <a href="#">link 3</a>             <menu class="extralinks">                 <li>                     <a href="#">link 4</a>                 </li>                 <li>                     <a href="#">link 5</a>                 </li>             </menu>         </li>     </menu> </div> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -