Html 单击透明的 .png

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3080746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 03:32:24  来源:igfitidea点击:

Clicking through a transparent .png

htmlcsspngtransparentmyspace

提问by gpretty

First off, I would like to say that myspace is a pain. But, musicians love it, and I can make some money doing layouts for them. I overlayed a layer of .png's over myspace's original look, but need to utilize the myspace music player. So, I made a picture frame that surrounds the myspace player that has a transparent center so you can see the myspace player. unfortunately, the player doesn't have full functionality. It seems to respond correctly when I hover, but not when I click. does anyone know how to solve this problem?

首先,我想说 myspace 是一种痛苦。但是,音乐家喜欢它,我可以为他们做布局赚钱。我在 myspace 的原始外观上覆盖了一层 .png,但需要使用 myspace 音乐播放器。所以,我制作了一个围绕 myspace 播放器的相框,它有一个透明的中心,这样你就可以看到 myspace 播放器。不幸的是,播放器没有完整的功能。当我悬停时它似乎响应正确,但当我点击时却没有。有谁知道如何解决这个问题?

You can see what I'm talking about here: myspace.com/gprettydesigns

你可以在这里看到我在说什么:myspace.com/gprettydesigns

回答by Guillaume Esquevin

add

添加

pointer-events: none;

on your overlay to alow click events to pass through it. It's a fairly recent property so not all browser may understand it.

在您的叠加层上以允许点击事件通过它。这是一个相当新的属性,因此并非所有浏览器都可以理解它。

More informations on pointer-events on https://developer.mozilla.org/en/css/pointer-events

有关https://developer.mozilla.org/en/css/pointer-events上的指针事件的更多信息

回答by Adam Crume

The best way would generally be to slice the image up into pieces and place them so that nothing overlays the music player.

最好的方法通常是将图像切成碎片并放置它们,以便没有任何东西覆盖音乐播放器。

回答by Cheesebaron

Maybe you could use z-index to position the image underneath the player, more on this here: http://www.echoecho.com/csslayers.htm

也许您可以使用 z-index 将图像定位在播放器下方,更多信息请点击此处:http: //www.echoecho.com/csslayers.htm

回答by Dwayne Charrington

Put the background image on a div then use z-index to position it behind the player. The advantage of putting a background image on a div and using z-index is that it'll be faster than using an actual inline image.

将背景图像放在 div 上,然后使用 z-index 将其放置在播放器后面。将背景图像放在 div 上并使用 z-index 的优点是它比使用实际的内嵌图像更快。

回答by Frankie

Clap clap clap to you! I've done sone MySpace tweaking and know it's a real PITA.

鼓掌鼓掌给你!我对 MySpace 进行了一次调整,并知道这是一个真正的 PITA。

Change the CSS here:

在此处更改 CSS:

#shell {
    visibility:hidden;
    z-index:200;
}

I don't remember if this is feasible or if they only accept inline CSS.

我不记得这是否可行,或者他们是否只接受内联 CSS。

Not really question related but now you can also have bandpages on facebook via RootMusic. MySpace will probably be overrun in no time so I would also give them a look.

与问题无关,但现在您也可以通过RootMusic在 facebook 上拥有乐队页面。MySpace 可能很快就会被淹没,所以我也会给他们看看。

Good luck dealing with the spaghetti tables of MySpace.

祝您在处理 MySpace 的意大利面桌时好运。