0

アンカーを作りたいBranche 1

ページ「ダイスカード」ではBranchen、リンク付きの div ( ) が表示されます。私の問題は、リンクをクリックしBranche 1ても divBranche 1に移動しないことです。何かアドバイスはありますか?

ここでjsフィドル

HTML

<div data-role="content" id="branchen" name="branche">
    <div data-role="header" data-theme="d">
        <a href="#menupanel" data-icon="bars" data-iconpos="notext" data-shadow="false" data-iconshadow="false" data-corners="true" data-wrapperels="span"  title="Menu"></a>
        <h1>Branchen</h1>
    </div>

    <div id="Branche">
        <p><a href="#b1">Branche 1</a></p>
        <p><a href="branche2" >Branche 2</a></p>
        <p><a href="#">Branche 3</a></p>
        <p><a href="#">Branche 4</a></p>
        <p><a href="#">Branche 5</a></p>
        <p><a href="#">Branche 6</a></p>
    </div>

    <div  id="branche1" name="b1">
        <div data-role="header" data-theme="d">
                <a href="#menupanel" data-icon="bars" data-iconpos="notext" data-shadow="false" data-iconshadow="false" data-corners="true" data-wrapperels="span"  title="Menu"></a>
                <h1>Branche 1</h1>
        </div>
                <img src="bilder/branche1.jpg" width="100%" height="100%">
    </div>

    <!-- Other branches -->

</div>
4

1 に答える 1

1

アンカー リンク ( ) はではなく に#b1一致する必要があります。idname

しかし、あなたの問題はjQueryモバイルからも来ています。data-ajax="false"アンカーを機能させるには、アンカー リンクで指定する必要があります。

<a href="#branche1" data-ajax="false">Branche 1</a>

<div id="branche1">
    ...
</div>

更新された JSFiddle
jQuery モバイル リファレンス

于 2013-10-18T07:51:34.607 に答える