0

我需要一些帮助,有一个选择列表,现在您可以通过单击右侧滚动到下一个“商店”。但不能让左键去上一个“商店”。有一个商店列表,您可以在每个商店之间水平滚动。

这是右键:

$(function() {
var scrollerwidth = 0;
var scroller = $("#scroller");

$("#scroller li").each(function() {
    scrollerwidth += $(this).width() + 1;
});
$("#scroller").width(scrollerwidth);
$("#scroller li:first-child").attr('id', 'current');

var iscroll = new IScroll('#countylist', { 
        eventPassthrough: true, 
        scrollX: true, 
        scrollY: false 
});

$("#scrollnext").click(function() {
    current = document.getElementById("current");
    current.id = "";
    //var next = $("#current").next();
    var next = current.nextSibling.nextSibling;
    next.id = "current";

        iscroll.scrollToElement(next);
    });

    }

)

HTML:

<div id="scrollnext" class="scrollnav next">
            <a href="Javascript:;"><span>&raquo;</span></a>
        </div>
        <div id="countylist">
            <div id="scroller">
                <ul>
                    <? foreach ($counties as $i => $c): ?>
                    <li>
                        <a id="county_<?=$i?>" href="javascript:" class="stopped"><span><?=utf8_decode($c)?> (<?=count($stores_by_county[$c])?>)</span></a>
                    </li>
                    <? endforeach ?>
                </ul>

我需要什么才能获得它?

4

0 回答 0