【问题标题】:How to make direction of input text in jquery mobile right to left?如何在jquery mobile中从右到左制作输入文本的方向?
【发布时间】:2016-12-02 14:12:53
【问题描述】:

在 jQuery mobile 中,我使用了输入文本:

<input type="text" data-clear-btn="true" id="txt_name_contractor">

在我的 css 文件中我设置了这个属性:

direction : rtl
text-align : right

但是当我输入这个输入文本时,它是从左到右的。 我应该如何解决这个问题?

【问题讨论】:

标签: jquery jquery-mobile


【解决方案1】:
function rtl(element) {   
    if(element.setSelectionRange) {
        element.setSelectionRange(0,0);
    }
}

$('.myInput').keyup(function(e) {
    rtl(this);
});

here 的回答,@Anshul

Fiddle

【讨论】:

    猜你喜欢
    • 2014-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-21
    • 1970-01-01
    • 2017-08-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多