2013-10-18 55 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