[英]Set letter spacing of last character in input field
I'm currently creating an input field that requires letter spacing, but if the last letter is spaced it shifts everything out of alignment... I was just wonder if there would be anyway of finding the last character of the input field which will be the 13th character with jquery or JavaScript and setting the letter spacing to 0. 我当前正在创建一个需要字母间距的输入字段,但是如果最后一个字母间隔开,它将使所有内容不对齐...我只是想知道是否总会找到输入字段的最后一个字符第13个字符(带有jquery或JavaScript),并将字母间距设置为0。
Any help appreciated. 任何帮助表示赞赏。
Check out Lettering.js . 查看Lettering.js 。 It wraps characters in HTML, allowing you to manipulate them more finely with CSS.
它使用HTML包装字符,使您可以使用CSS更好地操作它们。
If I understand you correctly, you are trying to trim the trailing space right?? 如果我对您的理解正确,那么您正在尝试调整尾随空间吗?
If so you can simply trim the input field value every time it changes. 如果是这样,您只需在每次更改输入字段值时对其进行修剪。 Here is the JQuery solution.
这是JQuery解决方案。
$.trim(MyInput.value); $ .trim(MyInput.value);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.