Hi: got some html like:
<div class="class" >
<div class="class" >
</div>
</div>
And some css like:
div.class:hover
{
border-width:2px;
border-style:inset;
border-color:red;
}
When I hover over the inner div, both divs get the red border. Is it possible to stop the propagation and get the red border on the inner div using css?
Thanks.
EDIT : starting with the answer pointed to by borrible I ended up with:
$("div.class").mouseover(
function(e) {
e.stopPropagation();
$(this).css("border-color", "red");
}).mouseout(
function() {
$(this).css("border-color", "transparent");
});
Shame it's not css but does the job. Thanks everyone, didn't get what I wanted but learned lots of new stuff. Ain't stack overflow great :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…