最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

angularjs模態(tài)框的使用代碼實(shí)例

 更新時間:2019年12月20日 10:56:09   作者:求知若渴的蝸牛  
這篇文章主要介紹了angularjs模態(tài)框的使用代碼實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

這篇文章主要介紹了angularjs模態(tài)框的使用代碼實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

編寫html頁面

1.觸發(fā)模態(tài)框的點(diǎn)擊事件

<div>
<button type="button" class="btn btn-primary" ng-click="openAddModal()" data-toggle="modal"
data-target="#documentOprModal" style="margin-left: 10px;float:left">
<i class="glyphicon glyphicon-plus"></i>{{ 'i18n.add' | translate }}
</button>
</div>

2.模態(tài)框頁面

<div class="modal fade" id="documentOprModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-lg" role="document" style="width: 600px;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
            aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"> 文檔入庫</h4>
      </div>
      <div class="modal-body">
        <!--開發(fā)-->
        <form name="docForm" id="docForm" novalidate>
          <!-- 分類 -->
          <div class="form-group">
            <label class="col-lg-12 col-md-12 col-xs-12" style="padding: 0;">分類:</label>
            <div class="input-group col-lg-12 col-md-12 col-xs-12">
              <div class="input-group">
                <input type="text" ng-model="document.classification_name" class="form-control"
                  placeholder="選擇分類">
                <div class="input-group-btn">
                  <button type="button" class="btn btn-default" style="height: 30px"
                    ng-click="toggleDetail()"> <span class="caret"></span></button>
                </div>
              </div>
              <div ng-show="isShowDetail" style="position: absolute;z-index: 9999;width: 560px;">
                <div class="panel panel-default">
                  <div class="panel-body list-group list-group-contacts">
                    <div>
                      <ul id="classify-tree" class="ztree"></ul>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- 星級 -->
          <div class="form-group">
            <label class="col-lg-12 col-md-12 col-xs-12" style="padding: 0;">星級:</label>
            <div class="input-group col-lg-12 col-md-12 col-xs-12">
              <ui-select ng-model="document.starGrade" theme="selectize">
                <ui-select-match placeholder="請選擇星級">
                  <span ng-bind="$select.selected.name"></span>
                </ui-select-match>
                <ui-select-choices
                  repeat="item.id as item in (starGrades | filter: $select.search) track by $index ">
                  <div ng-bind-html="item.name | highlight: $select.search"></div>
                </ui-select-choices>
              </ui-select>
            </div>
          </div>
          <!-- 井號 -->
          <div class="form-group">
            <label for="jhText">井號:</label>
            <input type="text" class="form-control" id="jhText" ng-model="document.jh">
          </div>
          <!-- 作者 -->
          <div class="form-group">
            <label for="authorText">作者:</label>
            <input type="text" class="form-control" id="authorText" ng-model="document.author">
          </div>
          <!-- 單位 -->
          <div class="form-group">
            <label for="unitText">單位:</label>
            <input type="text" class="form-control" id="unitText" ng-model="document.unit">
          </div>
          <!-- 日期 -->
          <div class="form-group">
            <label for="writeDate">寫作日期:</label>
            <input type="date" class="form-control" id="writeDate" ng-model="document.writeDate">
          </div>
          <!-- 簡介 -->
          <div class="form-group">
            <label for="introductionTextArea">簡介:</label>
            <textarea class="form-control" id="introductionTextArea" ng-model="document.introduction"
              rows="5" cols="60"></textarea>
          </div>
          <!-- 可能的查詢關(guān)鍵字 -->
          <div class="form-group">
            <label for="keyPackageTextArea">可能的查詢關(guān)鍵字:</label>
            <textarea class="form-control" id="keyPackageTextArea" ng-model="document.keyPackage" rows="5"
              cols="60"></textarea>
          </div>
          <!-- 文件 -->
          <div class="form-group">
            <div id="inputContent">
              <input id="importFile" type="file" name="file" class="file-loading">
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" ng-click="submitFileInfo()"><i class="fa fa-check"></i>{{ 'i18n.save'
          | translate }}
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal" style="margin: 0px 20px;"><i
            class="fa fa-ban"></i>{{
          'i18n.cancel' | translate }}
        </button>
      </div>
    </div>
  </div>
</div>

3.編寫對應(yīng)的js

/**
         * 點(diǎn)擊 添加事件打開模態(tài)框
         */
        function openAddModal() {
          $('#documentOprModal').modal({
            show: true,
            keyboard: false,
            backdrop: 'static'
          });
        }

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

昌图县| 万州区| 安西县| 武陟县| 阳春市| 九龙城区| 甘洛县| 米脂县| 平谷区| 和静县| 深水埗区| 哈密市| 通化县| 深泽县| 瓮安县| 衡山县| 玉环县| 明星| 盈江县| 新丰县| 铅山县| 收藏| 儋州市| 梓潼县| 东海县| 波密县| 常州市| 镇安县| 崇明县| 理塘县| 卓资县| 平原县| 孙吴县| 江油市| 通道| 许昌市| 大姚县| 玉田县| 枞阳县| 都匀市| 遵化市|