jQuery localScroll只能在IE7中工作

时间:2010-01-19 13:28:56

标签: jquery jquery-plugins

我有以下使用Ariel Flesler的scrollTo和localScroll插件的jQuery代码:

$(document).ready(function(){

    $('#navigation').localScroll({
        target: '#scrollpane',
        queue: true,
        duration: 1500
    });

});

我有以下CSS:

#scrollpane {
height: 400px;
width: 950px;
overflow: hidden;
}

以下标记:

    <ul id="navigation">
        <li>
            <a href="#smallgallery" title="Small Studio">Small<br/><span>SMALL STUDIOS</span></a>
        </li>
        <li>
            <a href="#mediumgallery" title="Medium Studio">Medium<br/><span>MEDIUM STUDIOS</span></a>
        </li>
        <li>
            <a href="#largegallery" title="Large Studio">Large<br/><span>LARGE STUDIOS</span></a>
        </li>
    </ul>

<div id="scrollpane">
    <div id="smallgallery">
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
    </div>

    <div id="mediumgallery">
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
    </div>

    <div id="largegallery">
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
        <img class="img" src="/content/img/gallery-holder.jpg" width="946" height="398" alt="Gallery Image" />
    </div>
</div>

它仅在IE7中正常工作,并且在包括FF,IE8和Chrome等在内的任何其他浏览器中都不起作用!所有这一切都是移动几个PX并停止

之前有人见过这个或有任何想法如何修复它?

提前致谢

1 个答案:

答案 0 :(得分:1)

尝试制作overflow: hidden;并将其更改为overflow: auto;