Shows any numeric value in word in different styles, so you don't have to count your input
$('#tooltipExample1').inword({type: 'tooltip'})
$('#tooltipExample2').inword({type: 'tooltip', position : 'top', backgroundColor: '#D91E18'})
$('#tooltipExample3').inword({type: 'tooltip', position : 'bottom', color: '#000', backgroundColor: '#E9EDEF'})
$('#tooltipExample4').inword({type: 'tooltip', position : 'left', backgroundColor: '#4B77BE'})
$('#readonlyExample1').inword()
$('#readonlyExample2').inword({type: 'tooltip'})
$('#readonlyExample3').inword({type: 'helper'})
# | First | Last | Basic (Helper on Hover) | Home Rent (Helper on Click) | Medical (Tooltip on Right) | Conveyance (Placer) | Mobile Bill (Helper on Left) | Total (Tooltip on Bottom) |
---|---|---|---|---|---|---|---|---|
1 | Mark | Otto | 11000 | 4000 | 1,320 | 2000 | 600.50 | 15,320 |
2 | Jacob | Thornton | 24000 | 5000 | 2,900 | 3040 | 700.66 | 32,600 |
3 | John | Wick | 14000 | 6000 | 1900 | 2600 | 850.01 | 20,900 |
4 | John | Doe | 14000 | 7000 | 3000 | 2060 | 920.88 | 21,600 |
$(".fix-helper-hover").inword({hover: true});
$(".fix-helper-click").inword();
$(".fix-tooltip-right").inword({type: 'tooltip'});
$(".fix-placer").inword({type: 'placer', placerId: 'placer1', hover: true});
$(".fix-helper-left").inword({ type: 'helper', position: 'left', hover: true});
$(".fix-tooltip-bottom").inword({type: 'tooltip', position: 'bottom'});
# | First | Last | Basic (Helper on Bottom) | Home Rent (Helper on Right) | Medical (Tooltip on Right) | Conveyance (Placer) | Mobile Bill (Helper on Left) | Total (Tooltip on Bottom) |
---|---|---|---|---|---|---|---|---|
1 | Mark | Otto | ||||||
2 | Jacob | Thornton | ||||||
3 | John | Wick | ||||||
4 | John | Doe |
$(".input-helper-bottom").inword({position: 'bottom'});
$(".input-helper-right").inword();
$(".input-tooltip-right").inword({type: 'tooltip'});
$(".input-placer").inword({type: 'placer', placerId: 'placer2'});
$(".input-helper-left").inword({position: 'left'});
$(".input-tooltip-bottom").inword({type: 'tooltip', position: 'bottom'});
InWord works with it jQuery and Bootstrap. After Jquery and Bootstrap, just add the inword.js and inword.css, and see the magic!
Just add $('element').inword()
to your DOM element, and nothing else!
$('elements').inwords({ type: "helper", //default#helper, tooltip, placer value: null, //if value is given, it will be override origina value position: "right", //applicable for 'tooltip/helper' only; values : right, left, top, bottom; default: right color: "#ffffff", backgroundColor: "#47a3da", prefix: null, suffix: null, placerId: null, //DOM id where you want to show the placer, applicable for placer only hover: false, //applicable for non-input element only case: 'ucfirst', //ucfirst, upper, lower wordJoiner: '-', //twenty-five, forty-five, if revoked twenty five, forty five thousandSeperator: '', //nine thousand four hundred sixty, if ',' given, nine thousand, four hundred sixty ignoreDecimal: false, //decimal value will not be shown });
InWord has nothing to do with the disabled Input, in such case, take the disabled input inside any DOM element i.e. span, div etc. and define the value and other properties applied on the parent DOM element
$('#disabledHelper').inword({value: 546898})
Parameter | Data Type | Values | Default | Description |
---|---|---|---|---|
type | string | helper | tooltip | placer | helper | |
value | numeric | If 'value' is given, it will ignore the original value of the DOM and this value will be shown in words | ||
position | string | right | left | top | bottom | right | applicable for type helper & tooltip, defines which position in words will be shown |
color | string | #fff | text color, any valid hex color code | |
backgroundColor | string | #47a3da | background color, any valid hex color code | |
prefix | string | prefix will be shown at the front of in words, useful for showing data like '$ forty five' | ||
suffix | string | prefix will be shown at the end of in words, useful for showing data like 'forty five only' | ||
placerId | string | applicable for 'placer' only, DOM ID of where to show the inwords value. If this value is given, in word will be shown inside this element in your page. Inword does not handle any event/design of this element except showing the word value inside this element, for any event/design i.e. show/hide this element, user must do it by himself | ||
hover | boolean | true | false | false | applicalble for only non-input element, decide whether to show Inword on the hover of the element |
case | string | ucfirst | upper | lower | ucfirst | handle word case of Inwords |
wordJoiner | string | - | shows Inwords like 'twenty-five', 'forty-five', if empty string '' is given for this value, Inwords will be shown as 'twenty five', 'forty five' | |
thousandSeperator | string | shows Inwords like 'nine thousand four hundred sixty', if ',' given for this value, 'nine thousand, four hundred sixty' | ||
ignoreDecimal | boolean | true | false | false | if true, decimal value will not be shown |