Answer the question
In order to leave comments, you need to log in
How to avoid script code duplication?
There are two fields: name and date.
When you enter data, the font is scaled using a small inputfit plugin script.
The problem is that for the first field I have a maximum text height of 60px, and for the second 30px. And this parameter is regulated in the code of the plugin itself. I don't know how to take it out.
At the moment, I stupidly copy the code with a different name and use two different plugins for two fields, but this is no good. How to solve it correctly?
Example here: https://jsfiddle.net/962p3ffd/1/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question