Prevent horizontal “scrolling” of a text input?

后端 未结 4 883
余生分开走
余生分开走 2020-12-18 23:32

I am working on a format input field in html, css and js.

One example would be a date format field with following pattern: **.**.****. When I am typing

4条回答
  •  萌比男神i
    2020-12-18 23:52

    Thanks for the advise with the wrapper, I had the same problem in firefox. In Chrome I fixed it using JS and the scrollLeft method (which will not work in ff on the other hand). In jQuery:

    $('input').live('keyup', function() {
        $(this).parent().scrollLeft(0);
    });
    

提交回复
热议问题