简体   繁体   English

放大和模糊CSS中的图像具有对所有浏览器的响应

[英]Zoomin and Blur the image in css With responsive to all Browsers

While clicking an image, the image should zoom in and set as background for the page with blurred property. 单击图像时,图像应放大并设置为具有模糊属性的页面的背景。

I tried with the following code,.. 我尝试了以下代码,..

<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);
}

Here i set the image with 100% of Width and Height. 在这里,我将图像的宽度和高度设置为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; }

The selected image haven't set as background and no property have set on Blurring. 所选图像尚未设置为背景,并且“模糊”没有设置任何属性。

I have used this link . 我已经使用了此链接 It only works on Chrome and Opera, not for other common browsers... 它仅适用于Chrome和Opera,不适用于其他常见的浏览器...

Give some suggestions on it 给一些建议

i'm very happy to share this solution with you all.. 我很高兴与大家分享这个解决方案。

I tried the following code for filter option in firefox to get the solution 我在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");

You can find the solution here. 您可以在此处找到解决方案

But still searching for the solution in IE, and for Safari blur option will work on Safari6.0 or Later. 但仍在IE中搜索解决方案,并在Safari6.0或更高版本上可以使用Safari模糊选项。 But Unfortunately Safari for Windows has been discontinued. 但是不幸的是,Windows版的Safari已停产。 The most recent Safari version you can get is 5.1.7. 您可以获得的最新Safari版本是5.1.7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM