1

I don't have any code to provide as to what I've tried so far because it's just a hypothetical question at this point.

I have a large image, and it is centered width-wise in one area of a CSS grid. The large image is "zoned" into three vertical sections, with a smaller graphic inside each section (one in the left section, one in the middle, and one in the right section).

I am trying to have a version of each respective smaller graphic enlarged whenever a mouseOver or hover event takes place in the graphic element's respective vertical section.

Rather than split the large image into three adjacent images, I was wondering if I instead used three grid-areas for the large image, if it is possible to detect when a specific grid-area is hovered over or entered with the cursor. Any ideas?

4

2 回答 2

2

网格轨道不是元素,它们只是用于调整实际元素大小和位置的抽象布局概念。如果您想知道某物何时悬停,则需要在您尝试检测的区域中使用实际元素。

于 2018-09-18T02:40:24.657 回答
-3

您是否尝试过使用 CSS:hover选择器?如果你为每一列分配一个唯一的类名并使用 :hover 选择器,你可能会得到你想要的结果。如果没有,可以使用一些简单的 javaScript 或 jQuery 来完成

于 2018-09-18T00:14:08.000 回答