【问题标题】:Bootstrap jQuery ui dialog conflictBootstrap jQuery ui 对话框冲突
【发布时间】:2015-10-16 02:40:35
【问题描述】:

我试图向我的引导网站添加一个简单的对话框,但我可以做到这一点。我的链接似乎出了点问题,因为当我在空白网站(没有引导链接)上测试对话框时,它运行良好。请看我的代码...

请尽量简单:

<!doctype html>
<html lang="en">
    <head>
    <meta charset="utf-8">
    <title>jQuery UI Dialog - Default functionality</title>

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="jquery-style.css">
    <link rel="stylesheet" href="/resources/demos/style.css">

    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
      <script>
      $(function() {
        $( "#dialog" ).dialog({
        modal:true,
        show: {effect:"fade",
        duration:250},
        hide: {effect:"fade",
        duration:250}
        });
      });
      </script>
    </head>
    <body>
    </body>
</html>

【问题讨论】:

  • 你应该只使用 bootstrap-theme css 和一个 jQuery 版本。

标签: javascript jquery html twitter-bootstrap dialog


【解决方案1】:

Stefanos Ioannou,您使用的是 2 jquery 版本,为什么不放最新版本。

或使用 jQuery.noConflict();准备好文档,这可能会解决您的问题。

【讨论】:

  • 我的朋友,只有您删除 1 个链接的解决方案对我有效
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-12
  • 1970-01-01
  • 1970-01-01
  • 2023-03-31
  • 2015-10-26
  • 2012-05-16
相关资源
最近更新 更多