https://github.com/kosich/jq-joined-text-entries
jQuery plugin to virtually join input-s and textarea-s for navigation
https://github.com/kosich/jq-joined-text-entries
Last synced: 11 months ago
JSON representation
jQuery plugin to virtually join input-s and textarea-s for navigation
- Host: GitHub
- URL: https://github.com/kosich/jq-joined-text-entries
- Owner: kosich
- License: isc
- Created: 2014-12-25T16:10:06.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-26T15:59:45.000Z (over 11 years ago)
- Last Synced: 2025-03-24T20:38:48.068Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://kosich.github.io/jq-joined-text-entries/
- Size: 180 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#jq-joined-text-entries
jQuery plugin to virtually join input-s and textarea-s in vertical navigation
See [example](http://kosich.github.io/jq-joined-text-entries/) or check `test/simple.html`, `test/textarea.html`, `test/two-sets.html`
Usage:
```javascript
$('form').find('.text-entry').joinTextEntries();
```
Theres only one parameter available:
- `focusHandler :: function(HTMLElement, jQuery.Event)`. A function to handle the focus job. Will be called with two params:
1 `next` -- element which should be focused
2 `event` -- jQuery event, that was triggered
Example with `focusHandler`, which hides *switched from* element and shows *switched to* element:
```javascript
function handle(element, e){
$( e.target ).hide()
$( element ).show().focus();
}
$(':input').joinTextEntries({
focusHandler : handle
}).filter(':not(:first)').hide();
```
**NOTE**: there's no way currently to trigger focus event on element, unless you are using your own `focusHandler`
**NOTE**: navigation is implemented only vertically (not grid or horizontal) in order how elements are stored in jQuery object