I've incorporated a css3 transition
to control the duration of scaling and background changes:
.logo-square, .logo-bg{
transition: 0.7s;
}
Additionally, I'm utilizing this jQuery
snippet to scale the box (since jQuery is being used. Keep in mind: Achieving this with pure CSS using the :hover selector is also an option):
$('.logo-square').css({
'-webkit-transform': 'scale(0.6)',
'-moz-transform': 'scale(0.6)',
'-o-transform': 'scale(0.6)'
});
Furthermore, here's how you can revert back:
$('.logo-square').css({
'-webkit-transform': 'scale(1)',
'-moz-transform': 'scale(1)',
'-o-transform': 'scale(1)'
});
Make use of .css
instead of .attr()
VIEW SAMPLE DEMO
UPDATE: You have the option to address this issue solely with CSS by leveraging the :hover
selector
Here's an example:
.logo-square, .logo-bg{
transition: 0.7s;
}
.bm-logo:hover > .logo-square{
-webkit-transform: scale(0.6);
-moz-transform: scale(0.6);
-o-transform: scale(0.6);
}
.bm-logo:hover > .logo-bg, .bm-logo:hover > .logo-square{
fill: #b565a7;
}
VIEW SAMPLE DEMO - PURE CSS APPROACH