我在制作地图时遇到问题。我用桌子意识到了这一点,但是悬停太慢了。那么,您可以建议我使用哪些工具来解决我的问题?我应该使用画布吗?还有什么更好的方法 - 在客户端使用 json 生成地图还是在服务器上生成地图?
完整示例: http: //jsfiddle.net/MSpbW/3/(表是自动生成的)。
html:
<tbody>
<tr>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
</tr>
<tr>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-border"></td>
</tr>
<tr>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-border"></td>
</tr>
<tr>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-empty" style=""></td>
<td class="cell cell-hotel-border"></td>
</tr>
<tr>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
<td class="cell cell-hotel-border"></td>
</tr>
</tbody>
js:
$(document).ready(
function() {
var color;
$(".cell-hotel-empty").hover( function () {
color = $(this).css('background');
$(".cell-hotel-empty").css('background', '0');
}, function() {
$(".cell-hotel-empty").css('background', color);
}
)
}
)