【发布时间】:2016-10-10 05:55:07
【问题描述】:
我使用 flexslider 显示带有缩略图的幻灯片。最近我添加了一个 css 代码以在缩略图悬停时显示覆盖。但问题是当我点击缩略图时没有任何反应。
.flex-control-nav li{
position: relative;
}
.flex-control-nav li img{
position: relative;
z-index: 2;
}
.flex-control-nav li:hover img{
opacity: .5;
}
.flex-control-nav li::after{
display: block;
content: " ";
position: absolute;
width: 100%;
height: 100%;
top: 100%;
background-color: rgba(0, 0, 0, 0.8);
background-image: url(//i.imgur.com/xMS5K4O.png);
background-repeat: no-repeat;
background-position: center center;
background-size: 40px;
z-index: 1;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.flex-control-nav li:hover::after{
top: 0;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
但是当我删除content: " "; 块时,它似乎可以工作,否则点击缩略图时什么也没有发生。
这是一个滑块的演示slider demo
谁能告诉我我做错了什么?
【问题讨论】:
-
滑块可能有它自己的事件处理程序,而这些事件处理程序没有设置为与您的自定义叠加层一起使用?
-
@adeneo 问题是这在模板jsfiddle.net/r4uthech/2 之外有效,但是当我添加到我的模板时它会中断。我一直在经历,但我无法弄清楚是什么原因造成的
标签: javascript jquery css flexslider