Modal for mobile
Installation
First, run the command:
bower install modalsThen, 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
Stringmessage text - callback
Functioncallback function - title
Stringtitle
confirm
- message
Stringmessage text - callback
Functionconfirm callback - cancle
Functioncancle callback - title
Stringtitle
message
- message
Stringmessage text - time
Number|Booleantimeout to remove the modal - callback
Functioncallback function - overlay
Booleaninsert overlay
action
- optional
Arrayoptional - callback
Functioncancle callback