简体   繁体   English

悬停时的图像效果不透明

[英]Image Effect on Hover not transparent

Is it somehow possible to make a image have an hover effect if the hovered place of the image, is not transparent. 如果图像的悬停位置不透明,是否有可能使图像具有悬停效果。

As I have a image with some transparent. 因为我有一个透明的图像。

Then I want to make a hover effect which will first run when the mouse is over the image on a place where the image is not transparent. 然后,我想制作一个悬停效果,当鼠标悬停在图像不透明的位置上时,它将首先运行。

Is that possible somehow? 有可能吗?

Hope it is understand able. 希望它能理解。

也许有可能,以某种方式可以固定位置或坐标值,我认为您应该使用画布并将图像放置在其中,并借助鼠标事件可以捕获鼠标功能并尝试使用jQuery来实现悬停效果。

Have you tried with the map tag? 您是否尝试过使用map标签? http://www.w3schools.com/tags/tag_map.asp http://www.w3schools.com/tags/tag_map.asp

Its possible using the canvas element and I actually made a plugin for this^^ Maybe this might help you: https://github.com/Bahlor/jQuery-Pixel-Related-Object-Selection 它有可能使用canvas元素,我实际上为此做了一个插件^^也许这可能对您有帮助: https : //github.com/Bahlor/jQuery-Pixel-Related-Object-Selection

This script allows to check for transparent / non-transparent areas of an image and also allows clickthrough if another element is behind a transparent area of an overlapping element. 该脚本允许检查图像的透明/非透明区域,并且如果另一个元素位于重叠元素的透明区域之后,还可以单击。 Works with image elements and divs using background-image. 使用背景图像处理图像元素和div。

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

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