简体   繁体   English

在输入字段中设置最后一个字符的字母间距

[英]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.

相关问题 如何在文本输入字段中实现没有字母间距的最后一个字母? - How to achieve the last letter without letter-spacing in a text input field? 删除输入字段jQuery上的最后一个字符 - Remove last character on input field jQuery 在输入字段的最后一个字母后显示一个特定的符号 - show a specific symbol after the last letter in an input field 如何在输入字段中找到最后一个字母的绝对或相对 position? - How to find absolute or relative position of last letter inside an input field? 如何在点击时从输入字段中删除最后一个字符? - How do I remove last character from input field on click? JS/JQuery - 如果它是第一个和/或最后一个字符,则从输入字段中删除空格 - JS/JQuery - Remove space from input field if it is the first and/or last character 如何使用AngularJS删除输入字段的最后一个字符 - how to remove the last character of an input field using AngularJS javascript - 将字母字符从键盘事件转换为另一个字符并将该新字符插入输入字段(在线键盘布局) - javascript - Convert letter character from keyboard event to another character and insert that new character into input field (online keyboard layout) 在输入字段字母中显示带延迟字母的文本 - Display text in input field letter for letter with delay 当内容大于输入字段(在Chrome中)时,如何将光标/尖号移动到输入字段中的最后一个字符? - How to move cursor/caret to last character in input field when content is larger than input field (in Chrome)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM