Fancybox 3:为左和右设置不同的光标滑块右侧

时间:2017-08-15 14:35:09

标签: javascript jquery css fancybox fancybox-3

我为网站设置了fancybox 3插件(http://fancyapps.com/fancybox/3/)并正在自定义其外观。我已经更改了箭头的CSS,用户可以使用它滑动到下一个/上一个图像,以便可点击滑动到下一个图像的区域覆盖屏幕的49%左右,即用户可以随时点击在每张图片的左侧或右侧滑动到下一张图片。

现在我想为滑块的每一侧设置自定义光标;右侧应显示右箭头,左侧应显示左箭头。我目前的问题是我无法为滑块的任何一侧设置光标,仅适用于一般的可点击区域。如何区分这两者并为每个设置不同的滑块?

这里是我已更改的jquery.fancybox.css部分以及显示其当前版本的.gif部分(我已将可点击区域的颜色设为绿色,以使其更加明显):

/* Navigation arrows */

.fancybox-arrow {
  position: absolute;
  top: 0;
  margin: 0 0 0 0;
  height: 100%;
  width: 49%;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  background-color: rgba(137, 255, 139, 0.4);
  cursor: pointer;
  z-index: 99995;
  opacity: 1;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transition: opacity .25s; 
}

.fancybox-arrow:hover {
  cursor: -webkit-image-set(url(Cursor-Right.png) 1x, url(Cursor-Rightx2.png) 2x), pointer;
}

在.gif中,您可以看到光标变为右箭头,但它会应用于滑块的两侧。

enter image description here

1 个答案:

答案 0 :(得分:2)

请检查左侧和右侧的css类到fancybox已有的箭头。试着用它们,例如.fancybox-arrow--left {your css here }。同样,它也有 - 也是。

希望这会有所帮助。快乐的编码。

相关问题