绝对定位在锚点顶部的 HTML 元素不会阻止点击锚点?
我正在自定义音频播放器 - http://www.jplayer.org/latest/demo-01 /。我所做的是将播放进度条扩大一点,以便在其中显示当前播放曲目的标题。
一切都很好,我有一个绝对定位的元素,其中包含很好地位于进度条内的标题。但是,当我在栏内单击以扫描歌曲时,标题元素会妨碍并阻止单击栏。
所以,是的,我正在尝试找到一种方法来在锚点顶部显示元素,而不妨碍单击锚点。任何想法表示赞赏!
I am customizing an audio player - http://www.jplayer.org/latest/demo-01/. What I have done is expanded the play progress bar to be a bit bigger in order to have the title of the currently playing track displayed inside it.
That all worked fine, I have an absolutely positioned element containing the title sitting nicely inside the progress bar. But when I click inside the bar to scan through the song the title element gets in the way and prevents clicking on the bar.
So yeah, I'm trying to find a way to display an element on top of an anchor without it getting in the way of clicking on the anchor. Any ideas appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从标题上方的链接定位某些元素或伪元素,如下所示: http://jsfiddle.net /kizu/TteeJ/,
z-index
比标题的 z-index 大。但链接不得有除
static
之外的任何position
,否则z-index
将不起作用。You can position some element or pseudo-element from the link above the title, like this: http://jsfiddle.net/kizu/TteeJ/, with
z-index
bigger than one that title have.But the link mustn't have any
position
other thanstatic
, or thez-index
won't work.