When hover a image, the rest of images changes the filter

前端 未结 3 1046
暖寄归人
暖寄归人 2021-01-24 13:24

I have 10 images, and when I hover one, I want the 9 remaining to change the filter.

This is what I have:

CSS

#posts-wrapper:hov         


        
3条回答
  •  面向向阳花
    2021-01-24 13:57

    Try

     $(".posts").mouseover(function () {
         $('.posts').css("-webkit-filter", "blur(10px)"); // added this to add blur to all images
         $(this).css("-webkit-filter", "none");
     });
    
     $(".posts").mouseleave(function () {
         $(this).css("-webkit-filter", "blur(10px)");
     });
    

提交回复
热议问题