简体   繁体   English

可点击元素上的不可点击元素

[英]Non clickable element on a clickable element

We have a slider Revolution slider but it hasn't got arrows on thumbnails. 我们有一个滑块Revolution滑块,但是缩略图上没有箭头。 We manually added the arrows but those were unclickable and thumbnails did not scroll. 我们手动添加了箭头,但这些箭头不可单击,缩略图无法滚动。

So, How do I put an arrow image on the thumbnails so when somebody clicks on the arrows the thumbnail behind the arrow gets clicked? 因此,如何将箭头图像放在缩略图上,以便当有人单击箭头时,单击箭头后面的缩略图?

We just want an arrow to show up and does nothing. 我们只想显示一个箭头,什么也不做。

So, without code to take a look at, it sounds like you are wanting something like pointer-events: none 因此,无需查看代码,听起来就好像需要pointer-events: none类的东西pointer-events: none

This property is supported by all modern browsers, including IE11: https://caniuse.com/#feat=pointer-events 所有现代浏览器(包括IE11)都支持此属性: https ://caniuse.com/#feat=pointer-events

On the arrow images you are adding on top of the thumbnails, add that CSS property to them and they will no longer react to clicks, drags, etc. This will allow users to basically click through them. 在要添加到缩略图上方的箭头图像上,将CSS属性添加到它们中,它们将不再对单击,拖动等作出反应。这将允许用户基本上单击它们。 It might look like this in your css: 在您的CSS中可能看起来像这样:

.left-arrow {
    /** your other css here **/
    pointer-events: none;
}

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

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