How to get Anchor Links to work in Jquery Mobile?

后端 未结 7 2291
情书的邮戳
情书的邮戳 2020-12-08 20:47

Jquery Mobile has decided to treat anchor links as page requests of sort. However, this isn\'t good if you have a load of blog posts which have anchor links to the same page

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 21:13

    You can add the following code to the end of your page:

     
    

    And add the class "native-anchor" to your anchor links.

    It is not a total sollution, because the back button of your browser will move you to the previous page and not to the position of the link, but it is better than the links not working at all.

    I found this sollution here: jQuery Mobile Anchor Linking

提交回复
热议问题