我有这个代码,但它不工作 Chrome 22.0.1229.94 m。
<div id='botonera'>
<button id='restaurar'>Restaurar</button>
<button id='blur'>Blur</button>
<button id='greyscale'>Greyscale</button>
<button id='sepia'>Sepia</button>
</div>
<script type="text/javascript">
var imagen = document.getElementById('imagen');
document.getElementById('restaurar').onclick = function() {
imagen.className = 'restaurar';
}
document.getElementById('blur').onclick = function() {
imagen.className = 'blur';
}
document.getElementById('greyscale').onclick = function() {
imagen.className = 'greyscale';
}
document.getElementById('sepia').onclick = function() {
imagen.className = 'sepia';
}
</script>
只有灰度不起作用,模糊,棕褐色“恢复”工作正常。谢谢!