zoukankan      html  css  js  c++  java
  • zbb20171215 bootstrap model 模态框

    1.页面中添加modal 
    
    <!-- 模态框(Modal) -->
    <div class="modal fade" id="showModal" tabindex="-1" role="dialog" 
       aria-labelledby="myModalLabel" aria-hidden="true">
       <div class="modal-dialog" style="900px;">
          <div class="modal-content">
    //内容动态填充
          </div><!-- /.modal-content -->
    </div><!-- /.modal -->
    </div>
    2.数据格式。页面动态生成a 标签
    <a data-toggle='modal'   data-target='#showModal' onclick=targetto('"  + row.id + "')>"+ row.title+"</a>";
    
    
    3.单击事件
     function targetto(id){
                 $("#showModal").modal({
                     remote: "showAction.action?id="+id
                 });
                 }
    
    
    4.每次隐藏时,清除数据。确保点击时,重新加载
        $("#showModal").on("hidden.bs.modal", function() {
            $(this).removeData("bs.modal");
        });
    5.
  • 相关阅读:
    上传文件事件并校验:event.target.files && event.target.files[0]
    深浅拷贝
    Git学习
    Flex弹性布局
    hive
    222
    错误总结
    Redis小结2
    spark小结
    kafka详解
  • 原文地址:https://www.cnblogs.com/super-admin/p/8182309.html
Copyright © 2011-2022 走看看