我喜欢在鼠标悬停时突出显示每个框,我可以显示效果,但问题是当我悬停它时,框看起来像向右移动/扩展一点。那么我该如何避免呢?
我该如何避免这种情况?
html
<div id="divtargetDay_1__Assigned" class=" divday divfloatpointerleft"></div>
<div id="divtargetDay_2__Assigned" class=" divday divfloatpointerleft"></div>
<div id="divtargetDay_3__Assigned" class=" divday divfloatpointerleft"></div>
<div id="divtargetDay_4__Assigned" class=" divday divfloatpointerleft"></div>
<div id="divtargetDay_5__Assigned" class=" divday divfloatpointerleft"></div>
<div id="divtargetDay_6__Assigned" class=" divday divfloatpointerleft"></div>
css
.divborderhighlight {
border:1px solid red;
}
.divfloatpointerleft {
cursor:pointer;
float:left;
}
.divday {
width: 56px !important;
height: 56px !important;
margin-right:4px;
}
JS
function dayHover(index) {
labels[index].hover(function () {
$(this).addClass('divborderhighlight');
}, function () {
$(this).removeClass('divborderhighlight');
});
}