Код: Выделить всё
$(document).ready(function(){
var color = "white";
$('#yellowPaint').click(function(){
color = "yellow";
})
$('#redPaint').click(function(){
color = "red";
})
$('#purplePaint').click(function(){
color = "purple";
})
$('#bluePaint').click(function(){
color = "blue";
})
$('#greenPaint').click(function(){
color = "green";
})
$('#orangePaint').click(function(){
color = "orange";
})
$('#whitePaint').click(function(){
color = "white";
})
$('#blackPaint').click(function(){
color = "black";
})
$('#massiveTable td').mouseenter(function(){
$(this).addClass(color);
});
});
Код: Выделить всё
.white {
background-color: white;
}
.green {
background-color: green;
}
.blue {
background-color: blue;
}
.black {
background-color: black;
}
.red {
background-color: red;
}
.yellow {
background-color: yellow;
}
.orange {
background-color: orange;
}
.purple {
background-color: purple;
}
Подробнее здесь: https://stackoverflow.com/questions/210 ... dded-class