【问题标题】:Jquerymobile anchor tag issueJquerymobile 锚标签问题
【发布时间】:2012-10-19 05:40:45
【问题描述】:

我正在使用 jQuery 移动。并且在它的锚标记中总是在请求 url 之前添加一个 # 值。这样网站的第一个默认页面就会运行,然后在 dom 中添加下一页。但在我的情况下,锚标签没有添加哈希值。我该如何添加它们。

这是我页面的头部分

<head runat="server">
    <title>Index</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
    <link href="/Content/style.css" rel="stylesheet" type="text/css" />
</head>

提前感谢

【问题讨论】:

    标签: jquery asp.net asp.net-mvc jquery-mobile


    【解决方案1】:
    Don't use rel=external attribute with anchor tag, If you are used
    You can also use on click event : $.mobile.changePage($("#pageid"), "flip", true, true);
    $("#anchortagid").live("click",function(event){
    if(event.handled !== true){ 
        $.mobile.changePage("#pageid", {transition: "slide"});
    
    }
       return false;
    });
    

    【讨论】:

      猜你喜欢
      • 2011-01-15
      • 1970-01-01
      • 2018-06-30
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      • 1970-01-01
      • 1970-01-01
      • 2012-03-16
      相关资源
      最近更新 更多