【问题标题】:JQuery dialog triggered through button is not shown未显示通过按钮触发的 JQuery 对话框
【发布时间】:2021-02-19 21:24:19
【问题描述】:

我正在努力使用 Jquery 中的按钮打开<div>。 你可以看到我的页面(不工作)here

下面是我页面的代码。 可能我没有正确调用对话框,或者它与我正在使用的 fullCalendar 插件有某种冲突。

对话框包含我需要的内容,但未显示。

      <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
      <link rel="icon" href="img/clip.ico" />
      <link rel='stylesheet' href='js/fullcalendar/fullcalendar.css' />
      <link rel="stylesheet" href="css/kube.min.css" />
      <link rel="stylesheet" href="css/stile.css" />
      
      <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
      <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
      <script src='js/fullcalendar/jquery.min.js'></script>
      <script src='js/fullcalendar/moment.min.js'></script>
      <script src='js/fullcalendar/fullcalendar.js'></script>
      <script src='js/fullcalendar/it.js'></script>


     </head>
     <body>
    
    <button id="apricorsocae">lezioni corso CAE</button>
    
<div id="corsocae" title="lezioni corso CAE" style="display: none;"></div>

    <script>
      $( function() {
        $( "#corsocae" ).dialog({
          autoOpen: false,
          show: {
            effect: "blind",
            duration: 1000
          },
          hide: {
            effect: "explode",
            duration: 1000
          }
        });
     
        $( "#apricorsocae" ).on( "click", function() {
          $( "#corsocae" ).dialog( "open" );
        });
      } );
    </script>

【问题讨论】:

    标签: button jquery-ui-dialog


    【解决方案1】:

    找出冲突的部分:

    <script src='js/fullcalendar/jquery.min.js'></script>
    

    我已经删除了它,它似乎工作正常。

    【讨论】:

      猜你喜欢
      • 2019-10-22
      • 2014-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多