欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Bootstrap對(duì)話框使用實(shí)例講解

 更新時(shí)間:2016年09月24日 14:26:39   作者:hakase  
這篇文章主要為大家詳細(xì)介紹了Bootstrap對(duì)話框使用實(shí)例,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

使用模態(tài)框的彈窗組件需要三層 div 容器元素

分別為 modal(模態(tài)聲明層) dialog(窗口聲明層) content(內(nèi)容層)

在內(nèi)容層里面,還有三層,分別為 header(頭部)、 body(主體)、 footer(注腳) 

一個(gè)簡(jiǎn)單的對(duì)話框登陸/注冊(cè)例子

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Document</title>
 <link rel="stylesheet" href="./css/bootstrap.min.css">
 <script src="./js/jquery.min.js"></script>
 <script src="./js/bootstrap.min.js"></script>
 <style>
  .modal-dialog {
   width: 20%;
  }

  .modal-footer, .modal-header {
   text-align: center;
  }

  input {
   width: 80%;
  }

 </style>
</head>
<body>
 <!-- LOGIN MODULE -->
 <div id="loginModal" class="modal fade" tabindex="-1">
  <div class="modal-dialog">
   <div class="modal-content">
    <div class="modal-header">
     <button type="button" class="close" data-dismiss="modal">
      <span>&times;</span>
     </button>
     <h4 class="modal-title">會(huì)員登錄</h4>
    </div>
    <div class="modal-body">
     <label for="log_uname">
      <span>帳號(hào):</span>
      <input id="log_uname" name="log_uname" type="text" placeholder="input your account">
     </label>
     <br>
     <label for="log_passwd">
      <span>密碼:</span>
      <input id="log_passwd" name="log_passwd" type="password" placeholder="input your password">
     </label>
    </div>
    <div class="modal-footer">
     <button type="button" class="btn btn-primary">登錄</button>
     <button type="button" class="btn btn-warning" data-dismiss="modal">退出</button>
    </div>
   </div>
  </div>
 </div>

 <!-- LOGIN MODULE -->
 <div id="registerModal" class="modal fade" tabindex="-1">
  <div class="modal-dialog">
   <div class="modal-content">
    <div class="modal-header">
     <button type="button" class="close" data-dismiss="modal">
      <span>&times;</span>
     </button>
     <h4 class="modal-title">注冊(cè)會(huì)員</h4>
    </div>
    <div class="modal-body">
     <label for="uname">
      <span>帳號(hào):</span>
      <input id="reg_uname" name="reg_uname" type="text" placeholder="input your account">
     </label>
     <br>
     <label for="reg_passwd">
      <span>密碼:</span>
      <input id="reg_passwd" name="reg_passwd" type="password" placeholder="input your password">
     </label>
     <label for="reg_confirm_passwd">
      <span>確認(rèn):</span>
      <input id="reg_confirm_passwd" name="reg_confirm_passwd" type="password" placeholder="confirm your password">
     </label>
    </div>
    <div class="modal-footer">
     <button type="button" class="btn btn-primary">注冊(cè)</button>
     <button type="button" class="btn btn-warning" data-dismiss="modal">退出</button>
    </div>
   </div>
  </div>
 </div>

 <button class="btn btn-primary" data-toggle="modal" data-target="#loginModal">登陸</button>
 <button class="btn btn-warning" data-toggle="modal" data-target="#registerModal">注冊(cè)</button>
</body>
</html>

對(duì)話框其他知識(shí)

jQuery方式聲明對(duì)話框

$('#myModal').modal({
 show : true,
 backdrop : false,
 keyboard : false,
 remote : 'index.html',
});

jQuery方式顯示對(duì)話框

$('#myBtn').on('click', function () {
 $('#myModal').modal('show');
});

對(duì)話框的事件

show.bs.modal  ==> 在show方法調(diào)用時(shí)立即觸發(fā)

shown.bs.modal  ==> 在模態(tài)框完全顯示出來并且CSS動(dòng)畫完成之后觸發(fā)

hide.bs.modal ==> 在hide方法調(diào)用時(shí) 還未關(guān)閉隱藏時(shí)觸發(fā)

hidden.bs.modal ==> 在模態(tài)框完全隱藏之后并且CSS動(dòng)畫完成之后觸發(fā)

$('#myModal').on('show.bs.modal', function () {
 alert('show !');
});

邊緣彈出框

<button class="btn btn-lg btn-danger" type="button" data-toggle="popover"
 title="彈出框" data-content="這是一個(gè)彈出框">點(diǎn)擊彈出/隱藏彈出框</button>
<script>
 $('button').popover();
</script>

其他方法

$('button').popover('show'); //顯示
$('button').popover('hide'); //隱藏
$('button').popover('toggle'); //反轉(zhuǎn)顯示和隱藏
$('button').popover('destroy'); //隱藏并銷毀

事件

show.bs.popover ==> 在調(diào)用show方法時(shí)觸發(fā)

shown.bs.popover ==> 在顯示整個(gè)彈窗時(shí)觸發(fā)

hide.bs.popover ===> 在調(diào)用hide方法時(shí)觸發(fā)

hidden.bs.popover ==> 在完全關(guān)閉整個(gè)彈出時(shí)觸發(fā)

如果大家還想深入學(xué)習(xí),可以點(diǎn)擊這里進(jìn)行學(xué)習(xí),再為大家附兩個(gè)精彩的專題:Bootstrap學(xué)習(xí)教程 Bootstrap實(shí)戰(zhàn)教程

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

相關(guān)文章

  • D3.js實(shí)現(xiàn)繪制柱狀圖的教程詳解

    D3.js實(shí)現(xiàn)繪制柱狀圖的教程詳解

    這篇文章主要為大家詳細(xì)介紹了如何通過D3.js實(shí)現(xiàn)繪制柱狀圖,文中的示例代碼講解詳細(xì),對(duì)我們學(xué)習(xí)D3.js有一定的幫助,需要的可以參考一下
    2022-11-11
  • JS+Ajax實(shí)現(xiàn)百度智能搜索框

    JS+Ajax實(shí)現(xiàn)百度智能搜索框

    現(xiàn)在遇到這樣的需求,要求輸入一個(gè)a之后會(huì)出現(xiàn)包含a的下拉列表,當(dāng)我們點(diǎn)擊某一個(gè)的時(shí)候,搜索框中就會(huì)出現(xiàn)點(diǎn)擊的值。下面小編給大家分享同js和ajax實(shí)現(xiàn)百度智能搜索框,需要的的朋友參考下實(shí)現(xiàn)代碼
    2017-08-08
  • JavaScript實(shí)現(xiàn)搜索聯(lián)想關(guān)鍵字高亮功能

    JavaScript實(shí)現(xiàn)搜索聯(lián)想關(guān)鍵字高亮功能

    本文將詳解如何利用原生js+css+html實(shí)現(xiàn)的輸入框搜索聯(lián)想的功能,并集搜索關(guān)鍵字高亮效果,文中的示例代碼講解詳細(xì),需要的可以參考一下
    2022-06-06
  • JavaScript 中的運(yùn)算符和表達(dá)式介紹

    JavaScript 中的運(yùn)算符和表達(dá)式介紹

    這篇文章主要介紹了JavaScript 中的運(yùn)算符和表達(dá)式介紹,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下
    2022-09-09
  • 微信小程序?qū)崿F(xiàn)簡(jiǎn)單跑馬燈效果

    微信小程序?qū)崿F(xiàn)簡(jiǎn)單跑馬燈效果

    這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)簡(jiǎn)單跑馬燈效果 ,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-12-12
  • 基于Html+CSS+JS實(shí)現(xiàn)手動(dòng)放煙花效果

    基于Html+CSS+JS實(shí)現(xiàn)手動(dòng)放煙花效果

    這篇文章主要介紹了利用Html+CSS+JavaScript實(shí)現(xiàn)的放煙花效果,文中一共實(shí)現(xiàn)了兩種方式:手動(dòng)和自動(dòng),文中的示例代碼講解詳細(xì),感興趣的可以試一試
    2022-01-01
  • javascript頁(yè)面動(dòng)態(tài)顯示時(shí)間變化示例代碼

    javascript頁(yè)面動(dòng)態(tài)顯示時(shí)間變化示例代碼

    頁(yè)面動(dòng)態(tài)顯示時(shí)間變化的方法有很多,本文為大家介紹下使用javascript的具體實(shí)現(xiàn),感興趣的朋友不要錯(cuò)過
    2013-12-12
  • JS中判斷某個(gè)字符串是否包含另一個(gè)字符串的五種方法

    JS中判斷某個(gè)字符串是否包含另一個(gè)字符串的五種方法

    本文給大家?guī)鞪S中判斷某個(gè)字符串是否包含另一個(gè)字符串的五種方法,有string對(duì)象的方法,match() 方法,RegExp對(duì)象的方法,test() 方法,exec() 方法,具體內(nèi)容詳情大家參考下本文
    2018-05-05
  • 詳解JVM系列之內(nèi)存模型

    詳解JVM系列之內(nèi)存模型

    JVM是一種用于計(jì)算設(shè)備的規(guī)范,它是一個(gè)虛構(gòu)出來的機(jī)器,是通過在實(shí)際的計(jì)算機(jī)上仿真模擬各種功能實(shí)現(xiàn)的。JVM的內(nèi)存區(qū)域可以被分為:線程、棧、堆、靜態(tài)方法區(qū)。本文將介紹JVM的內(nèi)存模型,感興趣的小伙伴,可以參考下
    2021-06-06
  • Swiper如何實(shí)現(xiàn)兩行四列輪播圖效果實(shí)例

    Swiper如何實(shí)現(xiàn)兩行四列輪播圖效果實(shí)例

    大家應(yīng)該都知道,Swiper是純javascript打造的滑動(dòng)特效插件,面向手機(jī)、平板電腦等移動(dòng)終端,下面這篇文章主要給大家介紹了關(guān)于Swiper如何實(shí)現(xiàn)兩行四列輪播圖效果的相關(guān)資料,需要的朋友可以參考下
    2022-10-10

最新評(píng)論