사람들이 내용을 변경할 때 <textarea>
의 scrollheight를 얻고 싶습니다. 문제는 콘텐츠를 추가 할 때 증가하는 scrollheight를 얻을 수 있지만 콘텐츠를 삭제할 때 할 수 있습니다. '는 t는 ... 여기에 감소 scrollheight.And 코드내용을 삭제할 때 텍스트 영역의 스크롤 높이를 얻을 수 없습니다
$("textarea[id^='_sub_ialready_']").live("keydown keyup focus blur",
function()
{
if(aobj.minHeight == 0)
aobj.minHeight = $(this).height();
if($(this).attr("scrollHeight") > aobj.minHeight)
{
if($(this).attr("scrollHeight") > aobj.maxHeight)
{
nheight = aobj.maxHeight;
$(this).css("overflow-Y",'scroll');
}
else
{
nheight = $(this).attr("scrollHeight");
$(this).css("overflow-Y",'hidden');
}
$(this).height(nheight);
}
}
)
CSS 또는 약간을 지정할 수 있습니까? 코드가 더 많아서 우리가 뭘 더 잘 이해할 수 있을까요? 또한 scrollHeight를 가져 오는 것과 관련하여 다음 질문 중 하나를 확인해 보셨습니까? : http://stackoverflow.com/questions/5980150/jquery-js-get-the-scrollbar-height-of-an-textarea http :// /stackoverflow.com/questions/642353/dynamically-scrolling-a-textarea http://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize – elboletaire