Flex滑块图像模糊不清

时间:2013-06-19 19:55:44

标签: jquery image slider flexslider

我正在使用Flex滑块在我的网站上创建幻灯片。第一张图片显示正常,然后在出现之前,下面的图像在幻灯片放映下闪烁,当它出现时模糊且无法识别。

这是我的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>

2 个答案:

答案 0 :(得分:1)

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

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

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

答案 1 :(得分:0)

有时插件用十进制数计算转换, 并且由于它使用了CSS 3转换,因此Web工具包在十进制,

方面效果不佳

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

Seach for this: return(posCalc * -1)+“px”; 并为此改变:返回Math.floor(posCalc * -1)+“px”;