我试图在scrollHeight
调整窗口大小0.5秒后触发所有带有“ abc”类的textarea。
这条线似乎不起作用。 document.getElementsByClassName(".abc").style.height = (document.getElementsByClassName(".abc")).scrollHeight+px';
调整窗口大小后,如何触发所有类名称为“ abc”的文本区域以适合其内容高度?
$(window).resize(function() {
if(this.resizeTO) clearTimeout(this.resizeTO);
this.resizeTO = setTimeout(function() {
$(this).trigger('resizeEnd');
}, 500);
});
$(window).bind('resizeEnd', function() {
document.getElementsByClassName("abc").style.height = (document.getElementsByClassName("abc")).scrollHeight+'px';
});
$(window).bind('resizeEnd', function() {
$(".abc").height( $(".abc")[0].scrollHeight );
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句