I am just a beginner in jQuery. I would like to add an animation on my navigation menu. What I want is, I want to hide the menu item text initially and on hover the menu item font size should also increase as it zooms out.Also it should go back to the initial size when the mouse leaves the menu item.How can I change my code to accomplish this? Please help me. Here is my code:
$(document).ready(function() {
$(".menu_block").hover(function(){
$(this).animate({'width': '127px', 'height': '34px'}, 1500);
}, function(){
$(this).animate({'width': '35px', 'height': '6px'}, 1500);
});
});
.navigation{
position: fixed;
right: 50%;
top: 60px;
z-index: 9999;
}
.menu_block{
background: #33BEB1;
width: 35px;
height: 6px;
margin-bottom: 6px;
display: block;
}
.menu_block a{ color: #33BEB1; display: block; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<nav class="navigation">
<ul>
<li class="menu_block"><a href="#about">about</a></li>
<li class="menu_block"><a href="#services">services</a></li>
<li class="menu_block"><a href="#contact">contact</a></li>
</ul>
</nav>