2013-10-18 99 views
0

我想打一个锚Branche 1锚不工作

在网页“模卡”就可以看到一个div(Branchen)的链接。我的问题是,如果我点击链接Branche 1它不会去div Branche 1,有什么建议吗?

Here a js fiddle

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> 
+1

哪里是你的代码? –

+0

在js小提琴 – Leonardo20

+0

@ Leonardo20如果答案是正确的,请接受它对其他otheres – Ben10

回答

1

锚链接(#b1)必须匹配id,不name

但是你的问题也来自jQuery手机。为了使锚的作品,你需要你的锚链接上指定data-ajax="false"

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

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

Updated JSFiddle
jQuery mobile reference

+0

有帮助的答案它不起作用:/ – Leonardo20

+0

请参阅我的编辑,您需要在链接上添加'data-ajax =“false”'。 – zessx

+0

非常感谢你! :)) – Leonardo20