0

我正在使用 Flex-slider 在我的网站中创建幻灯片。第一张图片显示得很好,但之后以下图片在幻灯片放映前闪烁,然后出现,当它出现时,它变得模糊且无法识别。

这是我的 Jquery。图片的链接并不重要,所以我没有包含它。

<link rel="stylesheet" href="library/public/designs/flexslider/flexslider.css" type="text/css" media="screen" />
<script defer src="library/public/designs/flexslider/jquery-flexslider.js"></script>
<script src="library/public/designs/flexslider/jquery-easing.js"></script>
<script src="library/public/designs/flexslider/jquery-mousewheel.js"></script>
<script defer src="library/public/designs/flexslider/demo.js"></script>

<script>
// Can also be used with $(document).ready()
$(window).load(function() {
  $('.flexslider').flexslider({

 selector : ".slides > div.tile"


  });
});
</script>


<style>
.flexslider .slides > div.tile {
    display: none;
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden; /* Chrome and Safari */
    -moz-backface-visibility:hidden; /* Firefox */
    -ms-backface-visibility:hidden; /* Internet Explorer */
}
.flexslider {
    margin: 0;
    background: #fff;
    border: 0;
    position: relative;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    -o-border-radius: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    -o-box-shadow: none;
    zoom: 1;
}
.flex-control-nav {
       width: 100%;
       position: absolute;
       right: 10px;
       top: 10px;
      text-align: right;
     z-index: 100;
}
.flex-control-nav li {
    margin: 0 2px;
}
.flex-control-paging li a { 
    border: none;
    width: 11px;
    height: 11px;
    display: block;
    background: #ddd;
    cursor: pointer;
    text-indent: -9999px;
    border-radius: 0; 
    box-shadow: none;
   font-size: 0;
}
.flex-control-paging li a:hover { 
    background: #0068b3; 
}
.flex-control-paging li a.flex-active { 
    background: #0068b3;
    cursor: default;
}
.flex-direction-nav {
    *height: 0;
}
.flex-direction-nav a {
    width: 30px;
    height: 30px;
    margin: -20px 0 0;
    display: block;
    background: url(library/public/designs/flexslider/bg_direction_nav.png) no-repeat 0 0;
    position: absolute;
    top: 50%;
    cursor: pointer;
    text-indent: -9999px;
    opacity: 0;
    -webkit-transition: all .3s ease;
}
.flex-direction-nav .flex-next {
    background-position: 100% 0;
    right: -36px;
}
.flex-direction-nav .flex-prev {
    left: -36px;
}
.flexslider:hover .flex-next {
    opacity: 0.8;
    right: 5px;
}
.flexslider:hover .flex-prev {
    opacity: 0.8;
    left: 5px;
}
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover {
    opacity: 1;
}
.flex-direction-nav .flex-disabled {
    opacity: .3!important;
    filter: alpha(opacity=30);
    cursor: default;
}
</style>
4

2 回答 2

1

尝试在初始化滑块时禁用 CSS 过渡,如下所示:

<script>
    $(window).load(function() {
        $('.flexslider').flexslider({
            selector: ".slides > div.tile",
            useCSS: false
        });
    });
</script>

对我来说,像这样禁用 CSS-Transitions 也解决了许多其他问题。似乎并非所有浏览器都为 flexslider 中的 CSS-Transitions 做好了准备。

于 2013-06-20T21:26:16.707 回答
0

有时插件使用十进制数字计算过渡,并且由于它使用 CSS 3 过渡,因此 Web 工具包不能很好地处理小数,

我的解决方案是在计算位置时放置一个 Math.floor() 语句。

搜索这个:return (posCalc * -1) + "px"; 并为此进行更改:return Math.floor(posCalc * -1) + "px";

于 2013-08-08T17:16:55.550 回答