I have table which class is forum
. My jquery code:
<script type="text/javascript">
$(document).ready(function() {
$('.forum').bind("mouseover", function(){
var color = $(this).css("background-color");
$(this).css("background", "#380606");
$(this).bind("mouseout", function(){
$(this).css("background", color);
})
})
})
</script>
It perfectly works, but is it possible to do it in more efficient way without var color = $(this).css("background-color");
. Just after mouseout
leave the previous background-color and remove #380606
? Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…