使用方法:
1、添加js引用
<script src="//code.jquery.com/jquery.min.js"></script> <script src="js/textfit.js"></script>
2、为需要设置自适应的字体,添加CLASS“textfit”
1
2
3
|
<
div
class
=
"textfit"
>
textfit.js
</
div
>
|
3、设置最大/最小字体
1
2
3
4
5
|
<
div
class
=
"textfit"
data-textfit-min
=
"10px"
data-textfit-max
=
"48px"
>
textfit.js
</
div
>
|