Print when textarea has overflow

前端 未结 11 943
眼角桃花
眼角桃花 2020-12-04 23:59

I have a form with some text areas that allow a scroll bar when the text exceeds the text box. The user would like to be able to print the screen, and this text is not visib

11条回答
  •  离开以前
    2020-12-05 00:21

    This seems to work for applying to all elements that have overflowing content:

    $("textarea").each(function () {
        var Contents = $(this).val();
        if ($(this)[0].scrollHeight > $(this).height()) {
            $(this).after("");
            $(this).addClass("no-print");
        }
    });
    

提交回复
热议问题