Skip to content

Files

Latest commit

9aefdf0 · Jan 3, 2013

History

History
30 lines (18 loc) · 510 Bytes

Readme.md

File metadata and controls

30 lines (18 loc) · 510 Bytes

end-of

Check to see if you're at the end of an input element or textarea. Useful for "drifting" textareas with additional padding at the bottom.

Installation

$ component install matthewmueller/end-of

Example

var endOf = require('end-of'),
    textarea = document.getElementById('content');

endOf(textarea, function(end) {
  if (!end) return;
  textarea.scrollTop = textarea.scrollHeight;
})

API

endOf(el, fn)

Initialize the keydown listener on el.

License

MIT