auto fontsize
npm install self-adapt-fontsizeshell
npm install self-adapt-fontsize --save
`
#### local reference
`html
`
Usage
this plugin accepts 3 parameters: the dom element, the width of the dom element and the height of the dom element.
插件接受三个参数,分别是dom元素,dom元素的宽度,dom元素的高度
the following uses of this plugin are both right.
以下两种插件使用方式都是正确的。
`javascript
...
var safs = SelfAdaptFontSize.getInstance();
safs.fontSize(document.getElementById("test1"),600,60);
safs.fontSize(document.getElementById("test2"),400,40);
safs.fontSize(document.getElementById("test3"),300,30);
...
this is a test.
this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
`
*
`javascript
import SelfAdaptFontSize from 'self-adapt-fontsize';
...
const safs = SelfAdaptFontSize.getInstance();
safs.fontSize(document.getElementById('test1'), 600, 60);
safs.fontSize(document.getElementById('test2'), 400, 40);
safs.fontSize(document.getElementById('test3'), 300, 30);
...
this is a test.
this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
``