这段代码的目的是清空指定div的背景色,我把JS和JQ的代码都贴出来了,但不知道哪里写错了,除了最下面的("fill","none");,其它都不起作用。求指点,谢谢!
<script type="text/javascript">
$(document).ready(function(){
$("#clear_all_color").click(function(e){
document.getElementById('outside_show').style.backgroundColor='none';
document.getElementById('inside_show').style.backgroundColor='none';
document.getElementById('solid_c1_outside').style.backgroundColor='none';
document.getElementById('solid_c1_inside').style.backgroundColor='none';
document.getElementById('segmented_c1_outside').style.backgroundColor='none';
document.getElementById('segmented_c1_inside').style.backgroundColor='none';
document.getElementById('.swirl_c1_outside').style.backgroundColor='none';
document.getElementById('.swirl_c1_inside').style.backgroundColor='none';
$("#outside_show").css("background-color","none");
$("#inside_show").css("background-color","none");
$("#solid_c1_outside").css("background-color","none");
$("#solid_c1_inside").css("background-color","none");
$("#segmented_c1_outside").css("background-color","none");
$("#segmented_c1_inside").css("background-color","none");
$(".swirl_c1_outside").css("fill","none");
$(".swirl_c1_inside").css("fill","none");
})
});
</script>
清空背景颜色不能用none的。直接把css设置为空就可以了。