So, when the viewers mouseover the button we will add its padding to make it wide and decrease the button’s opacity when user click it.
Live Demo
CSS
1. Paste the following css code before the ]]></b:skin>
#menu-css li {
display: inline;
list-style: none;
}
#menu-css li a {
/* Border Radius */
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
/* Border Shadow */
-webkit-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
-moz-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
/* Animation (Webkit, Gecko & Mozilla) */
-webkit-transition-duration: 0.20s;
-webkit-transition-timing-function: ease-out;
-moz-transition-duration: 0.20s;
-moz-transition-timing-function: ease-out;
color: #ffffff;
background: #0158a9;
display: inline-block;
padding: 5px 15px;
outline: none;
text-decoration: none;
font-weight: bold;
}
#menu-css li a:hover {
background: #b20000;
padding: 5px 25px;
}
#menu-css li a:active {
background: #ff0000;
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}
2. Paste the Following code before the </head>.
<script type='text/javascript'>$(document).ready(function() {
$('#menu-jquery li a').hover(
function() {
$(this).css('padding', '5px 15px')
.stop()
.animate({'paddingLeft' : '25px',
'paddingRight' : '25px',
'backgroundColor':'rgba(0,0,0,0.5)'},
'fast');
},
function() {
$(this).css('padding', '5px 25px')
.stop()
.animate({'paddingLeft' : '15px',
'paddingRight' : '15px',
'backgroundColor' :'rgba(0,0,0,0.2)'},
'fast');
}).mousedown(function() {
$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.1)'}, 'fast');
}).mouseup(function() {
$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.5)'}, 'fast');
});
});
</script>
3. Click the SAVE TEMPLATE.$('#menu-jquery li a').hover(
function() {
$(this).css('padding', '5px 15px')
.stop()
.animate({'paddingLeft' : '25px',
'paddingRight' : '25px',
'backgroundColor':'rgba(0,0,0,0.5)'},
'fast');
},
function() {
$(this).css('padding', '5px 25px')
.stop()
.animate({'paddingLeft' : '15px',
'paddingRight' : '15px',
'backgroundColor' :'rgba(0,0,0,0.2)'},
'fast');
}).mousedown(function() {
$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.1)'}, 'fast');
}).mouseup(function() {
$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.5)'}, 'fast');
});
});
</script>
HTML
4. Add Following HTML code. ( Design > Page Elements > Add a Gadget > HTML/JavaScript )
4. Add Following HTML code. ( Design > Page Elements > Add a Gadget > HTML/JavaScript )
<ul id="menu-css">
<li><a href="#">Home</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Advertise</a></li>
<li><a href="#">Write for us</a></li>
</ul>
Important :- Replace # with your Link and change title your wish.. Save it
Share and Enjoy!
0 comments:
Post a Comment