Pretty Header
Split a text into lines with almost equal width.
Demo
Have a look at the demo page to see this script in action.
Usage
As npm package
$ npm install pretty-header
var prettyHeader = ;var i elements;elements = document;for i = 0; i < elementslength; i++ ;
As a script
As jQuery plugin
API
prettyHeader(element, option)
element
Type: Node
Container element.
option
Type: String|Function
Each line of text will be wrapper into the element with
applied white-space: nowrap
style. You can provide class name
or factory function for such elements.
If option is a string, it will be using as class for <span>
.
If option is a function, it should return new DOM-Node.
;
This trick may help to get neutral inline-styled element when ordinary
<span>
has inappropriate CSS.
License
MIT © Vladimir Kuznetsov