Giter VIP home page Giter VIP logo

bootstrap-submodal's Introduction

Bootstrap-SubModal

Add Sub-Modals to Bootstrap's Modals.

HTML

Sub modals are added to the .modal-body element of a modal. It's HTML structure is identical excluding the following two differences

  • Sub Modals do not have a .modal-header element
  • Sub Modals must have a class of .sub-modal (in addition to .modal)
<div class="modal hide fade">
    <div class="modal-header">[...]</div>
    <div class="modal-body">
    
        <!-- Your Sub Modal, requires sub-modal class -->
        <div class="modal sub-modal hide">[...submodal content...]</div>
        
        <p>[parent modal content]</p>
    </div>
    <div class="modal-footer">[...]</div>
</div>

## Data Attributes

This resembles Twitter Bootstrap's data API:

Opening

<a href="#mySubModal" class="btn" data-toggle="submodal">Open Sub Modal</a>

Closing

<a href="#mySubModal" class="btn" data-dismiss="submodal">Close Sub Modal</a>

## JS API
// Open
$('#mySubModal').subModal('open');

// Close
$('#mySubModal').subModal('close');

// Toggle
$('#mySubModal').subModal('toggle');

## Events
// Before Modal is Shown
$('#mySubModal').on('beforeShow', fn);

// Modal Shown
$('#mySubModal').on('show', fn);

// Modal Closed
$('#mySubModal').on('hide', fn);

Known Issues

Currently, there is a nasty overflow issue that may take a while to fix. Please reference the issues list.

License

MIT, dawg.

bootstrap-submodal's People

Contributors

jakiestfu avatar

Watchers

 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.