Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanety/jquery-simple-dialog
https://github.com/kanety/jquery-simple-dialog
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kanety/jquery-simple-dialog
- Owner: kanety
- License: mit
- Created: 2021-01-17T05:18:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-17T04:47:56.000Z (over 3 years ago)
- Last Synced: 2024-12-25T04:04:43.345Z (23 days ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-simple-dialog
A jquery plugin for simple dialog.
## Dependencies
* jquery
## Installation
Install from npm:
$ npm install @kanety/jquery-simple-dialog --save
## Usage
Build html as follows:
```html
Dialog Title
content
content
OK
Cancel
Open
```Then run:
```javascript
$('#content').simpleDialog({
opener: '#open',
closer: '#ok,#cancel'
});
```### Options
Draggable dialog:
```javascript
$('#content').simpleDialog({
dragger: '#drag'
});
```Modal dialog:
```javascript
$('#content').simpleDialog({
modal: true
});
```Focus elements when dialog is opened:
```javascript
$('#content').simpleDialog({
focus: '#ok'
});
```### Callbacks
Run callbacks when a dialog is opened or closed:
```javascript
$('#content').simpleDialog({
...
}).on('dialog:open', function(e, $handler) {
console.log("opened by " + $handler.attr('id'));
}).on('dialog:close', function(e, $handler) {
console.log("closed by " + $handler.attr('id'));
});
```## License
The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).