【问题标题】:Modal content not working模态内容不起作用
【发布时间】:2014-08-12 19:53:14
【问题描述】:

我已经开始使用 Modals 但是我遇到了一个小问题 - 我正在尝试将其中的几个放在一起,但我的代码中的某些内容将它们全部链接在一起,因此不允许我将不同的内容放入每个所以第一个内容中的任何内容最终都会在所有其他内容中覆盖我在其他机构中编写的任何内容。感谢任何可以帮助我弄清楚我的代码在做什么的人!

<button class="glyphicon glyphicon-folder-open" data-toggle="modal" data-target="#myModal">
</button>
 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <h4 class="modal-title" id="myModalLabel">MIDDLE TIER</h4>
          </div>
          <div class="modal-body">
           <div class="bs-example">
               <table class="table">
                   <thead>
                       <tr>
                           <th>RUN JOB</th>
                           <th>ACTION</th>
                           <th>TARGET</th>
                           <th>MODEL</th>
                           <th>REPORT KEY</th>
                           <th>REPORT NAME</th>

                       </tr>
                   </thead>
                   <tbody>
                       <tr>
                           <td>GL LOAD</td>
                           <td>PROFILE/IMPORT</td>
                           <td>CR Staging (For All Funds)</td>
                           <td>Not Indicated- To Be Developed</td>
                           <th>N/A</th>
                           <th>N/A</th>
                       </tr>

                   </tbody>
               </table>
           </div>
          </div>
          <div class="modal-footer">
          </div>
        </div>
      </div>
    </div>

【问题讨论】:

标签: html css modal-dialog jscript


【解决方案1】:

我最近遇到了类似的事情。我添加了以下 js 代码以在关闭时销毁模态,并且效果很好:

$(document).on('hidden.bs.modal', function (e) {
    $(e.target).removeData('bs.modal');
});

很难从提供的代码中判断您的问题是否相同,但值得一试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-21
    • 1970-01-01
    • 2013-04-17
    • 2014-05-07
    • 2012-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多