+ 1
Blur Hover Effect on Web Images
By using, .blur img:hover{ -webkit-filter: blur(5px); } I can blur my image using CSS when hovering over the image. But is there a way to blur all other images except the one i am hovering over now?
10 Réponses
+ 1
You need javascript
+ 1
Can you post your code here?
+ 1
Can you put in code playground?
+ 1
Window.onload
Document.getelementsbytagname img
Run for loop
+ 1
Add :not to the css selector
https://code.sololearn.com/WnkIa2HR9tc6/?ref=app
+ 1
Calviղ wow, magic O_o
0
Ok... can u help me with the code?
0
<div class="blur">
<img src="source1.jpg">
<img src="source2.jpg">
<img src="source3.jpg">
<img src="source4.jpg">
</div>
CSS
.blur img{
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.blur img:hover {
-webkit-filter: blur(5px);
}
0
<div class="blur">
<img src="source1.jpg">
<img src="source2.jpg">
<img src="source3.jpg">
<img src="source4.jpg">
</div>
CSS
.blur img{
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.blur img:hover {
-webkit-filter: blur(5px);
}
0
If it can't be done using CSS can u tell me how it's done using JavaScript.