简体   繁体   English

具有更多悬停效果的独特图像

[英]Unique image with more hover effects

I wanted to ask if it was possible, using only one image, to have more hover effects?我想问一下是否有可能只使用一张图片来获得更多的悬停效果? For example, a single image divided into columns and each column has its own effect, as if the image were divided into transparent areas.例如,将单个图像分成几列,每一列都有自己的效果,就像将图像分成透明区域一样。

Thank you, Carlo谢谢你,卡罗

I found a solution for my problem.我找到了解决我的问题的方法。

 .x { opacity:0; cursor: pointer;} .x:hover { opacity:1; }
 <svg width="600" height="600" viewBox="0 0 600 600"> <defs> <filter id="blur"> <feGaussianBlur stdDeviation="8"/> </filter> <image href="https://i.imgur.com/Lky5aRQ.jpg" width="600" height="600" id="img"/> <clipPath id="c1"> <path d="M0 0h100v600h-100z"/> </clipPath> <clipPath id="c2"> <path d="M100 0h100v600h-100z"/> </clipPath> <clipPath id="c3"> <path d="M200 0h100v600h-100z"/> </clipPath> <clipPath id="c4"> <path d="M300 0h100v600h-100z"/> </clipPath> <clipPath id="c5"> <path d="M400 0h100v600h-100z"/> </clipPath> <clipPath id="c6"> <path d="M500 0h100v600h-100z"/> </clipPath> </defs> <use xlink:href="#img"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c1)" class="x"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c2)" class="x"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c3)" class="x"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c4)" class="x"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c5)" class="x"/> <use xlink:href="#img" filter="url(#blur)" clip-path="url(#c6)" class="x"/> </svg>

Thank you谢谢

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

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