Hover Effect 3 Vers 4

by Koubenec

HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<div class="sample" onclick = "top.location.href='http://www.google.com'">
    Main Site
</div><div class="sample" onclick = "top.location.href='http://www.google.com'">
    Main Site
</div>

CSS

.sample { 
    background: #231F20; 
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding-bottom: 5px;
    color: #fff;
    font-size: 18pt;
    text-align: center;
    width: 250px;
    cursor: pointer;
}

JavaScript

$(document).ready(function(){
    $(".sample").mouseover(function() {
        $(this).animate({ backgroundColor: '#fff'},200);
        $(this).css('color', '#231F20');
    }          ).mouseout(function() {
        $(this).animate({ backgroundColor:'#231F20'},175);
        $(this).css('color', '#fff');
    });    
});