All I want to do is hide the class "col-a" and show "col-b" using jquery hover method but for some reason jquery is giving me some funky results.
here is the snippet
$(".col-a").hover(function(){
$(this).hide().next().show(1000)
}, function(){
$(".col-b").hide().prev().show(1000);
});
.hide {
display:none;
}
.col-a {
height:200px;
margin:10px;
float:left;
width:200px;
background-color:yellow;
}
.col-b {
height:200px;
margin:10px;
display:none;
float:left;
width:200px;
background-color:yellow;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="col-a">One</div>
<div class="col-b">Two</div>
<div class="col-a">One</div>
<div class="col-b">Two</div>
Here is a fiddle: