Jquery 在twitter引导模式中启用锚点

Jquery 在twitter引导模式中启用锚点,jquery,twitter-bootstrap,bootstrap-modal,Jquery,Twitter Bootstrap,Bootstrap Modal,我有一个引导模式,工作完美 模态的页眉/正文/页脚填充了正确的数据。在模态体中,我有一些与其他页面链接的内容,但由于某些原因,它们被“like”禁用 我猜引导应用了event.preventDefault();到模态体内部的所有链接,或类似的内容 有没有办法重新启用它们 HTML: × 假割台 Lorem Ipsum在 我的意思的一个例子可能是你标记模态的方式。也可以是您在项目中使用的一些自定义JS。请注意,我没有应用.ext\u link类,也没有使用任何自定义的JS来让锚工作 这是从文

我有一个引导模式,工作完美

模态的页眉/正文/页脚填充了正确的数据。在模态体中,我有一些与其他页面链接的内容,但由于某些原因,它们被“like”禁用

我猜引导应用了event.preventDefault();到模态体内部的所有链接,或类似的内容

有没有办法重新启用它们

HTML:


×
假割台
Lorem Ipsum在


我的意思的一个例子可能是你标记模态的方式。也可以是您在项目中使用的一些自定义JS。请注意,我没有应用
.ext\u link
类,也没有使用任何自定义的JS来让锚工作

这是从文档中简单地复制和粘贴。请注意,这是引导程序2.3.2

HTML:

×
模态头
一个好身体

接近 保存更改
这可能是您标记模式的方式。也可以是您在项目中使用的一些自定义JS。请注意,我没有应用
.ext\u link
类,也没有使用任何自定义的JS来让锚工作

这是从文档中简单地复制和粘贴。请注意,这是引导程序2.3.2

HTML:

×
模态头
一个好身体

接近 保存更改
好的,这是个棘手的问题。但我怀疑这只是发生在JSFIDLE中。我在html文件中创建了一个新的示例,将它放在apache中,它运行得非常完美。链接也起作用。以下是我使用的html:

<!DOCTYPE html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
        </style>
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">

     </head>
    <body>

        <div class="container">


<div class="modal show fadein static-modal">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Modal header</h3>
  </div>
  <div class="modal-body">
    <p><a href="https://www.google.com/"  class="ext_link">It was popularised</a></p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary">Save changes</a>
  </div>
</div>

<a href="https://www.google.com/"  class="ext_link">It was popularised</a>

        </div> <!-- /container -->

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>


        <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>

身体{
填充顶部:60px;
填充底部:40px;
}
&时代;
模态头


好的,这是个棘手的问题。但我怀疑这只是发生在JSFIDLE中。我在html文件中创建了一个新的示例,将它放在apache中,它运行得非常完美。链接也起作用。以下是我使用的html:

<!DOCTYPE html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
        </style>
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">

     </head>
    <body>

        <div class="container">


<div class="modal show fadein static-modal">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Modal header</h3>
  </div>
  <div class="modal-body">
    <p><a href="https://www.google.com/"  class="ext_link">It was popularised</a></p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary">Save changes</a>
  </div>
</div>

<a href="https://www.google.com/"  class="ext_link">It was popularised</a>

        </div> <!-- /container -->

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>


        <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>

身体{
填充顶部:60px;
填充底部:40px;
}
&时代;
模态头


OMG,发现了问题。看起来早上的大脑比晚上的好:)

出于某种原因,我在模式容器上设置了
data toggle=“modal”
。当然,这会禁用链接,因为它会触发模态本身

删除该选项后,修复了问题。这是固定的jsfiddle


sulfureous,谢谢你让我回到文档;)

OMG,发现了问题。看起来早上的大脑比晚上的好:)

出于某种原因,我在模式容器上设置了
data toggle=“modal”
。当然,这会禁用链接,因为它会触发模态本身

删除该选项后,修复了问题。这是固定的jsfiddle


sulfureous,谢谢你让我回到文档;)

你确定不仅仅是JSFIDLE做的吗?因为我在一个单独的html页面上试用过,效果很好。你确定不仅仅是JSFIDLE做的吗?因为我在一个单独的html页面上尝试了它,效果很好。不是JSFIDLE做的,检查我的答案和小提琴,效果很好。尝试使用show和静态模态类来实现模态。这就是问题中使用的内容。你的例子不符合。在jsfiddle中尝试上面的例子,让我知道它是否适合您。不是jsfiddle做的,检查我的答案和小提琴,它工作得很好。尝试为您的模态使用show和static模态类。这就是问题中使用的内容。你的例子不符合。在JSFIDLE中尝试上面的示例,并告诉我它是否适合您。
<!DOCTYPE html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
        </style>
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">

     </head>
    <body>

        <div class="container">


<div class="modal show fadein static-modal">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Modal header</h3>
  </div>
  <div class="modal-body">
    <p><a href="https://www.google.com/"  class="ext_link">It was popularised</a></p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary">Save changes</a>
  </div>
</div>

<a href="https://www.google.com/"  class="ext_link">It was popularised</a>

        </div> <!-- /container -->

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>


        <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>