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