单击图像时,图像应放大并设置为具有模糊属性的页面的背景。
我尝试使用以下代码,..
<style type="text/css">
body{
position: absolute;
margin-left: 100px;
right: 0;
z-index: 99999;
display: block;
background: url(music_album_img/images8.jpg);
width: 100%;
height: 100%;
-webkit-filter: blur(75px);
-moz-filter: blur(50px);
-o-filter: blur(75px);
-ms-filter: blur(75px);
filter: blur(75px);
}在这里,我将图像设置为100%的宽度和高度。
.mi {
position: fixed;
left: 0;
right: 0;
z-index: 9999;
margin-left: 20px;
margin-right: 20px;
}
#background-image, #background-image span {
background: #fff url(http://css-plus.com/examples/2012/03/gaussian-blur/i/fence-sprite.png) no-repeat left top;
height: 220px;
width: 320px;
position: relative;
}
#background-image span {
background-position: 0 -220px;
opacity: 0;
position: absolute;
left: 0;
top: 0;
z-index: 1;
-webkit-transition: opacity 0.3s ease-out;
-moz-transition: opacity 0.3s ease-out;
-ms-transition: opacity 0.3s ease-out;
-o-transition: opacity 0.3s ease-out;
transition: opacity 0.3s ease-out;
opacity: 1;
}
#background-image:hover span { opacity: 1; }所选图像尚未设置为背景,也未设置模糊属性。
我已经用过这个link了。它只适用于Chrome和Opera,不适用于其他常见的浏览器...
给出一些建议
发布于 2014-08-14 15:20:47
我很高兴能与大家分享这个解决方案。
我在firefox中尝试了以下过滤器选项代码来获得解决方案
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'effect-blur-1\'><feGaussianBlur stdDeviation=\'15\' /></filter></svg>#effect-blur-1");您可以找到解决方案here.
但仍然在IE中寻找解决方案,Safari模糊选项将在Safari6.0或更高版本上工作。但不幸的是,Safari for Windows已经停产。你能得到的最新的Safari版本是5.1.7。
https://stackoverflow.com/questions/25279277
复制相似问题