Javascript CSS-webkit过滤器不';t在Chrome 22.0中工作

Javascript CSS-webkit过滤器不';t在Chrome 22.0中工作,javascript,css,google-chrome,filter,webkit,Javascript,Css,Google Chrome,Filter,Webkit,我有这个代码,但它不适用于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'

我有这个代码,但它不适用于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>

餐馆老板
变得模糊不清
灰阶
乌贼墨
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';
}

只有灰度不起作用,模糊、深褐色和“恢复”效果很好。谢谢

您可能在CSS中将
grayscale
拼写为
greyscale
。两种拼写都是正确的,但只有第一种拼写有效

.greyscale {  
   -webkit-filter: grayscale(100%);
}

因为这是一个类名,所以可能没关系。@JanDvorak:我的错。应该为webkit筛选器更改它。我喜欢“两个…都是正确的,但只有第一个可以工作”:-)哦,对不起,你是对的,我在筛选器中丢失了一个字母“灰度”,谢谢!有用链接:你能给我们看看CSS吗?