Git Product home page Git Product logo

full-modal's Introduction

安装

引入样式
<link rel="stylesheet" href="./dist/jquery.plugin.full-modal.min.css" type="text/css">
引入js
<script src="./dist/jquery.plugin.full-modal.min.js"></script>

使用

HTML
<div class="ibs-full-modal-container" id="modal1">
  <div class="ibs-full-modal">
    <!--对话框头部-->
    <header class="ibs-modal-header">
      <h4 class="ibs-modal-title">对话框标题</h4>
      <span class="ibs-btn-close">&times;</span>
    </header>
    <div class="ibs-modal-body has-header has-footer">
     <!--内容放在这里-->
    </div>
    <!--对话框底部-->
    <div class="ibs-modal-footer text-right">
      <button class="btn btn-default" id="closeBtn">取消</button>
      <button class="btn btn-success">确定</button>
    </div>
  </div>
</div>

应用插件

   $('.ibs-full-modal-container').fullModal({
      closeWhenClickBackdrop: true,
      duration:500,
      trigger:'',
      beforeOpen: function () {
        console.log('beforeOpen was invoked');
      },
      afterOpen: function () {
        console.log('afterOpen was invoked');
      },
      beforeClose: function () {
        console.log('beforeClose was invoked');
      },
      afterClose: function () {
        console.log('afterClose was invoke');
      }
    });

打开对话框

  $('#modal1').fullModal('open');

关闭对话框

  $('#modal1').fullModal('close');

API说明

  1. closeWhenClickBackdrop:boolean,点击遮罩层时,是否关闭对话框,默认:true,optional.
  2. trigger: string,按钮的选择器,点击此按钮会打开对话框,如#my-button,optional.
  3. duration:number,动画持续时间,默认:300,optional.
  4. beforeOpen:Function,对话框打开之前调用,optional.
  5. afterOpen:Function,对话框架打之后调用,optional.
  6. beforeClose:Function,对话框关闭之前调用,optional.
  7. afterClose :Function,对话框关闭之后调用,optional.

full-modal's People

Contributors

parox2014 avatar

Watchers

James Cloos avatar Tirapong Chaiyakun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.