Change the or's to and's.
$(document).on("mouseenter", ".123456", function() {
if (this.id != 'f1' && this.id != 'c1') {
$(this).css("background-color", "green")
$(this).find('span').css("color", "red")
}
});
$(document).on("mouseleave", ".123456", function() {
if ((this.id != 'f1') && (this.id != 'c1')) {
$(this).css("background-color", "white")
$(this).find('span').css("color", "black")
}
});
This way, the hover effect will only be applied to elements whose id is not c1 AND to elements whose id is not f1.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…