Nivo Slider不能在IE7中正常工作。

3

我已经浏览了这个网站上关于Nivo Slider的许多帖子,涉及到这个问题。我已经检查了我的javascript中的逗号,看起来没问题:

<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'fade', 
        slices:15,
        animSpeed:500, 
        pauseTime:4000,
        startSlide:0,
        directionNav:false, 
        directionNavHide:false, 
        controlNav:true,
        controlNavThumbs:false, 
        controlNavThumbsFromRel:false, 
        controlNavThumbsSearch: '.jpg', 
        controlNavThumbsReplace: '_thumb.jpg', 
        keyboardNav:true,
        pauseOnHover:true, 
        manualAdvance:false, 
        captionOpacity:0.9, 
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, 
        lastSlide: function(){}, 
        afterLoad: function(){} 
    });
});
</script>

这里是它所引用的HTML文件。文件夹路径似乎是正确的(毕竟,在其他浏览器中可以正常使用!):

<div id="slider_wrapper">
        <div id="slider">
            <img src="/CoVPrototype/images/nivoslider/_img1.jpg" alt="" title="Discover City Parks" />
            <img src="/CoVPrototype/images/nivoslider/_img2.jpg" alt="" title="Enjoy Our Beautiful City" />
            <img src="/CoVPrototype/images/nivoslider/_img3.jpg" alt="" title="This is an example of a caption" />
            <img src="/CoVPrototype/images/nivoslider/_img4.jpg" alt="" title="This is Our Home" />
            <img src="/CoVPrototype/images/nivoslider/_img5.jpg" alt="" title="Mild Tempuratures and Natural Beauty" />
        </div>
    </div>

最后,这是 JavaScript 的链接:

<script src="/CoVPrototype/js/jquery.nivo.slider.pack.js" type="text/javascript"></script>

我浪费了半天的时间试图解决这个问题!希望这个强大的列表能够找出问题所在!!

考虑到CSS可能是罪魁祸首,我也会添加CSS:

#slider_wrapper {
    margin:0 auto;
    width:740px;
    height:360px;
}
#slider {
    width:738px; /* Change this to your images width */
    height:360px; /* Change this to your images height */
    background:url(/CoVPrototype/images/nivoslider/loading.gif) no-repeat 50% 50%;
    overflow:hidden;
    margin-top:25px;
    left:-96px;
    /*--Top right rounded corner--*/
    -moz-border-radius-topright: 5px;
    -khtml-border-radius-topright: 5px;
    -webkit-border-top-right-radius: 5px;
    /*--Top left rounded corner--*/
    -moz-border-radius-topleft: 5px;
    -khtml-border-radius-topleft: 5px;
    -webkit-border-top-left-radius: 5px;
    /*--Bottom right rounded corner--*/
    -moz-border-radius-bottomright: 5px;
    -khtml-border-radius-bottomright: 5px;
    -webkit-border-bottom-right-radius: 5px;
    /*--Bottom left rounded corner--*/
    -moz-border-radius-bottomleft: 5px;
    -khtml-border-radius-bottomleft: 5px;
    -webkit-border-bottom-left-radius: 5px;
}
#slider img {
    position:absolute;
    top:0px;
    left:0px;
    display:none;
}
#slider a {
    border:0;
    display:block;
}

.nivoSlider {
    position:relative;
}
.nivoSlider img {
    position:absolute;
    top:0px;
    left:0px;
}
/* If an image is wrapped in a link */
.nivoSlider a.nivo-imageLink {
    position:absolute;
    top:0px;
    left:0px;
    width:100%;
    height:100%;
    border:0;
    padding:0;
    margin:0;
    z-index:60;
    display:block;
}
/* The slices in the Slider */
.nivo-slice {
    display:block;
    position:absolute;
    z-index:50;
    height:100%;
    /*--Top right rounded corner--*/
    -moz-border-radius-topright: 5px;
    -khtml-border-radius-topright: 5px;
    -webkit-border-top-right-radius: 5px;
    /*--Top left rounded corner--*/
    -moz-border-radius-topleft: 5px;
    -khtml-border-radius-topleft: 5px;
    -webkit-border-top-left-radius: 5px;
    /*--Bottom right rounded corner--*/
    -moz-border-radius-bottomright: 5px;
    -khtml-border-radius-bottomright: 5px;
    -webkit-border-bottom-right-radius: 5px;
    /*--Bottom left rounded corner--*/
    -moz-border-radius-bottomleft: 5px;
    -khtml-border-radius-bottomleft: 5px;
    -webkit-border-bottom-left-radius: 5px;
}
/* Caption styles */
.nivo-caption {
    position:absolute;
    left:0px;
    bottom:0px;
    background:#F1F0EB;
    color:#5D79A1;
    filter: alpha(opacity=90);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
 /* Overridden by captionOpacity setting */
    width:100%;
    z-index:89;
    height:32px;
    /*--Bottom right rounded corner--*/
    -moz-border-radius-bottomright: 5px;
    -khtml-border-radius-bottomright: 5px;
    -webkit-border-bottom-right-radius: 5px;
    /*--Bottom left rounded corner--*/
    -moz-border-radius-bottomleft: 5px;
    -khtml-border-radius-bottomleft: 5px;
    -webkit-border-bottom-left-radius: 5px;
}
.nivo-caption p {
    padding:8px 5px 5px 11px;
    margin:0;
    font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size:1.1em;
}
.nivo-caption a {
    display:inline !important;
}
.nivo-html-caption {
    display:none;
}

我从未遇到在IE7中无法工作的问题(插件确实支持IE7),您是否收到了错误信息?如果是,它显示了什么?还是它只是默默地失败了? - RandomWebGuy
我看到的只有一直转啊转的加载动画... - art_wired
我假设/CoVPrototype在你的根目录中? - RandomWebGuy
我在本地主机上进行测试,这会有影响吗...你觉得呢? - art_wired
刚刚添加了CSS...以防万一 :S - art_wired
显示剩余4条评论
2个回答

7

我在NivoSlider和IE7中遇到了同样的问题,结果发现这是“pauseTime”属性的问题。

将其移动到您的jQuery函数的末尾并删除逗号。 这样做后,滑块在IE7中可以正常工作。

原始内容:

pauseTime: 4500, // How long each slide will show
pauseOnHover: true, // Stop animation while hovering

编辑

pauseOnHover: true, // Stop animation while hovering
pauseTime: 4500 // How long each slide will show

请查看Dev7Studios的支持论坛以获取更多信息。


对我没用,请帮助 - Shimmy Weitzhandler

1
我发现基本上和 Tyce Clee 发现的一样 - 只需确保最后一个参数末尾没有逗号。我觉得有必要发帖,因为这适用于任何参数,而不仅仅是暂停时间。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接