https://github.com/katt/promise-click
https://github.com/katt/promise-click
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/katt/promise-click
- Owner: KATT
- License: mit
- Created: 2013-10-01T13:08:08.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-24T15:37:02.000Z (over 12 years ago)
- Last Synced: 2024-10-04T16:41:35.825Z (over 1 year ago)
- Language: JavaScript
- Size: 324 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# Promise Click
Preload content of links before clicking
## Getting Started
Download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/KATT/promise-click/master/dist/promise-click.min.js
[max]: https://raw.github.com/KATT/promise-click/master/dist/promise-click.js
In your web page:
```html
jQuery(function($) {
$(document).on('promiseclick', 'a.ajax', function(event) {
event.preventDefault();
var $this = $(this);
event.data.promise.done(function (data) {
// do something with the data
});
});
});
```
## Documentation
_(Coming soon)_
## Examples
See [`demos/`](demos/index.html).
## Todo / wish list
* Delay mouseover promise with X milliseconds
* Options
* Mouseover delay
* Override promise generation
* Auto `preventDefault` on click
* Unit tests
* Clean-up old promises
* Prevent caching on rejected promises?
### Implemented
* Implement as a jQuery event, `jQuery.Event.promsieclick`
* Ability to unbind
* Support [virtual mouse][vclick]
* Clean-up interface (jQuery `.on()`-esque?)
[vclick]: http://api.jquerymobile.com/vclick/
## Release History
_(Nothing yet)_