Skip to content
Modal for mobile
JavaScript CSS HTML
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
components/zepto
dist
docs
src
.bowerrc
.gitignore
README.md
bower.json
gulpfile.js
index.html
package.json

README.md

Modal for mobile

Installation

First, run the command:

    bower install modals

Then, include the stylesheet file and javascript file to your web page.

    <link rel="stylesheet" href="dist/stylesheets/modals.css" />
    <script src="dist/javascripts/modals.js"></script>

Basic Usage

    modals.alert('夜空中最亮的星', function () {
        console.log(1);
    });
    $('#confirm').on('click', function () {
        modals.confirm('夜空中最亮的星', function () {
            console.log(1);
        }, function (event) {
            console.log('cancle', event);
        });
    });

Options

alert

  • message String message text
  • callback Function callback function
  • title String title

confirm

  • message String message text
  • callback Function confirm callback
  • cancle Function cancle callback
  • title String title

message

  • message String message text
  • time Number | Boolean timeout to remove the modal
  • callback Function callback function
  • overlay Boolean insert overlay

action

  • optional Array optional
  • callback Function cancle callback

github

Something went wrong with that request. Please try again.