Is it possible to make the following jQuery with pure CSS(3)?
$(".js.outer").hover(function() {
$(this).css({'border': '2px inset red'});
return false;
}, function() {
$(this).css({'border': 'none'});
return false;
});
$(".js.inner").hover(function(event) {
$(this).css({'border': '2px inset blue'});
return false;
}, function() {
$(this).css({'border': 'none'});
return false;
});
with this HTML
<div class="js outer">
<div class="js inner">
</div>
</div>
I have tried in this fiddle http://jsfiddle.net/AA9Nw/, however when I hover the inner element, the outer also gets the hover event. (with CSS)
On a side note, the jQuery one seems a bit buggy, when the mouse enters from the left or right the hover effect doesn't let go properly. Am I doing something wrong?