Blur effect CSS3 Firefox(linux)

倾然丶 夕夏残阳落幕 提交于 2019-12-30 05:28:04

问题


I'm trying to get a blur effect on my photogallery if the user is not registered. I got it, but only for chrome. In my Firefox 14.0.1 (linux) I'm not able to get it working

My html template (I develop under django)

<h2> Gallerie</h2>
<ul class="galeria" id="imagenes">
{% for image in gallery %}
    {% if user.is_authenticated %}
        <a rel="prettyPhoto[gallery]" href="{{image.url}}">
            <img width="120px" height="120px" alt="{{image.comment}}" src="{{image.url}}"/>
        </a>        
    {% else %}
        <img class="blur" alt="{{image.comment}}" src="{{image.url}}"/>
    {% endif %}
{% endfor %}
</ul>

My site.css

img.blur{
    -webkit-filter: grayscale(0.5) blur(10px);
    filter: grayscale(0.5) blur(10px);
    width:120px;
    height:120px;
}

Any help would be appreciated. Thanks :)


回答1:


Gecko does not support the filter property. It only works in IE (filter) and WebKit (-webkit-filter). To apply blur effects in Gecko-based browsers (like Firefox) you could make use of SVG Filters. Here is a good explanation how to use SVG Filters for a gaussian blur. These SVG Filters only work in Gecko so you still need your old code for WebKit & IE.




回答2:


This explanation worked better for me.

http://css-plus.com/2012/03/gaussian-blur/



来源:https://stackoverflow.com/questions/11984759/blur-effect-css3-firefoxlinux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!