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

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

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

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

編寫html頁面

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

<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

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

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

相關(guān)文章

  • 新鮮出爐的js tips提示效果

    新鮮出爐的js tips提示效果

    提示不難做,那個三角號樣式很難調(diào)兼容,死了好多腦細(xì)胞預(yù)覽主窗口提示錯位,保存本地測比較好。
    2011-04-04
  • JavaScript實現(xiàn)計算圓周率到小數(shù)點后100位的方法示例

    JavaScript實現(xiàn)計算圓周率到小數(shù)點后100位的方法示例

    這篇文章主要介紹了JavaScript實現(xiàn)計算圓周率到小數(shù)點后100位的方法,簡單分析了圓周率計算的原理并結(jié)合實例形式給出了javascript計算圓周率的具體操作技巧,需要的朋友可以參考下
    2018-05-05
  • JavaScript表單驗證實現(xiàn)代碼

    JavaScript表單驗證實現(xiàn)代碼

    這篇文章主要為大家詳細(xì)介紹了JavaScript表單驗證的實現(xiàn)代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-05-05
  • JavaScript選擇排序算法原理與實現(xiàn)方法示例

    JavaScript選擇排序算法原理與實現(xiàn)方法示例

    這篇文章主要介紹了JavaScript選擇排序算法原理與實現(xiàn)方法,簡單分析了選擇排序算法的概念、原理并結(jié)合實例形式分析了JavaScript選擇排序算法的相關(guān)實現(xiàn)技巧與操作注意事項,需要的朋友可以參考下
    2018-08-08
  • 用 js 的 selection range 操作選擇區(qū)域內(nèi)容和圖片

    用 js 的 selection range 操作選擇區(qū)域內(nèi)容和圖片

    本篇文章主要介紹了用js的selection range操作選擇區(qū)域內(nèi)容和圖片的相關(guān)知識。具有很好的參考價值。下面跟著小編一起來看下吧
    2017-04-04
  • 利用JS判斷客戶端類型你應(yīng)該知道的四種方法

    利用JS判斷客戶端類型你應(yīng)該知道的四種方法

    這篇文章主要給大家總結(jié)介紹了關(guān)于利用JS判斷客戶端類型的四種方法,比如通過通過判斷瀏覽器的userAgent、檢查是否是移動端(Mobile)、ipad、iphone、微信、QQ等的方法,需要的朋友可以參考借鑒,下面
    2017-12-12
  • js中數(shù)組Array的一些常用方法總結(jié)

    js中數(shù)組Array的一些常用方法總結(jié)

    Array()是我們在js中常常寫到的代碼,今天就總結(jié)哈Array的對象具有哪些方法,感興趣的朋友可以了解下
    2013-08-08
  • js實現(xiàn)點擊每個li節(jié)點,都彈出其文本值及修改

    js實現(xiàn)點擊每個li節(jié)點,都彈出其文本值及修改

    本篇文章主要分享了js實現(xiàn)點擊每個li節(jié)點,都彈出其文本值及修改的實例代碼,具有很好的參考價值,需要的朋友一起來看下吧
    2016-12-12
  • 用js實現(xiàn)控件的隱藏及style.visibility的使用

    用js實現(xiàn)控件的隱藏及style.visibility的使用

    用js控制控件的隱藏,使用style.visibility實現(xiàn) ,具體代碼如下,感興趣的朋友可以參考下哈,希望對大家有所幫助
    2013-06-06
  • 淺談Rx響應(yīng)式編程

    淺談Rx響應(yīng)式編程

    在學(xué)習(xí)Rx編程的過程中,理解Observable這個概念至關(guān)重要,常規(guī)學(xué)習(xí)過程中,通常需要進(jìn)行多次碰壁才能逐漸開悟。這個有點像小時候?qū)W騎自行車,必須摔幾次才能掌握一樣。當(dāng)然如果有辦法能言傳,則可以少走一些彎路,盡快領(lǐng)悟Rx的精妙
    2021-06-06

最新評論

合肥市| 肃宁县| 承德市| 濉溪县| 广南县| 东辽县| 即墨市| 麻江县| 徐水县| 白城市| 六安市| 高安市| 无棣县| 梓潼县| 垫江县| 大英县| 正镶白旗| 怀化市| 云浮市| 罗平县| 裕民县| 宜兰市| 渭源县| 华宁县| 额尔古纳市| 崇明县| 尚志市| 东城区| 麻江县| 达拉特旗| 蒙山县| 新干县| 建德市| 道真| 桐梓县| 乌鲁木齐市| 溧阳市| 房山区| 青冈县| 富民县| 泉州市|