Show cursor on two text box at same time

前端 未结 5 531
长情又很酷
长情又很酷 2021-01-20 04:30

I have two text boxes like,



Is it possible to focus th

5条回答
  •  天命终不由人
    2021-01-20 05:01

    I found http://codepen.io/keilin/pen/lCkap for css.

    And added:

    $("#left").on('keydown change', function(e) {
            $("#right").val($(this).val());
            console.log($("#right").val());
            $overlay.text($(this).val());
            var offset = $cursor.offset();
            var inputLeft = $(_this).offset().left;
            offset.left = Math.min($overlay.outerWidth(), $(_this).innerWidth() - 4);
            offset.left = inputLeft + Math.max(offset.left, 0);
            $cursor.offset(offset);
     });
    

    If i understand correctly, you want something this: https://jsfiddle.net/8csab3t1/1/

    ps: It's just an example. Please check with two chars.

提交回复
热议问题