我正在开发一个页面,该页面将为图像设置动画,并以模糊样式淡入。它适用于谷歌浏览器,但在 Mozilla Firefox 中没有。
我为 Mozilla firefox 尝试了这种方法。http://css-plus.com/2010/05/how-to-add-a-gaussian-blur-effect-to-elements-within-firefox/但图像不可见。
这是我的代码:
js:
<script type="text/javascript">
$(document).ready(function() {
$("img").css({
"filter": "blur(4px)",
"-webkit-filter": "blur(4px)",
"-moz-filter": "blur(4px)",
"-o-filter": "blur(4px)",
"-ms-filter": "blur(4px)",
"filter":"url('#blur1')"
});
window.setTimeout(function() {
$("img").css({
"filter": "blur(3px)",
"-webkit-filter": "blur(3px)",
"-moz-filter": "blur(3px)",
"-o-filter": "blur(3px)",
"-ms-filter": "blur(3px)",
"filter":"url('#blur1')"
});
}, 3000);
window.setTimeout(function() {
$("img").css({
"filter": "blur(2px)",
"-webkit-filter": "blur(2px)",
"-moz-filter": "blur(2px)",
"-o-filter": "blur(2px)",
"-ms-filter": "blur(2px)",
"filter":"url('#blur1')"
});
}, 3100);
window.setTimeout(function() {
$("img").css({
"filter": "blur(1.5px)",
"-webkit-filter": "blur(1.5px)",
"-moz-filter": "blur(1.5px)",
"-o-filter": "blur(1.5px)",
"-ms-filter": "blur(1.5px)",
"filter":"url('#blur1')"
});
}, 3200);
window.setTimeout(function() {
$("img").css({
"filter": "blur(1px)",
"-webkit-filter": "blur(1px)",
"-moz-filter": "blur(1px)",
"-o-filter": "blur(1px)",
"-ms-filter": "blur(1px)",
"filter":"url('#blur1')"
});
}, 3300);
window.setTimeout(function() {
$("img").css({
"filter": "",
"-webkit-filter": "",
"-moz-filter": "",
"-o-filter": "",
"-ms-filter": "",
"filter":"url('#blur1')"
});
}, 3400);
$("#promoIMG").fadeIn(5000);
});
</script>
html:
<div id="promoIMG">
<a href="main.php"><img src="images/akb1.png" alt="" onMouseOver="this.src='images/akb2a.png'" onMouseOut="this.src='images/akb1.png'"/></a><br/>
<img src="images/akb2.png" alt="AKB" />
</div>
</div>
<svg>
<filter id="blur1">
<svg:feGaussianBlur stdDeviation="1"/>
</filter>
</svg>
我哪里做错了?以及如何使其正确,以便 Mozilla Firefox 的页面动画在 chrome 中相同。
提前致谢