如何在IE中将resizer添加到textarea? [英] How to add resizer to textarea in IE?
问题描述
如何像在Chrome和Firefox中一样,在IE中向文本区域添加大小调整器?
How to add resizer to textarea in IE the same as in Chrome and Firefox?
jQuery.resizable()
对我不起作用.
推荐答案
Internet Explorer(和Microsoft Edge,自2016年5月5日起)不支持对textarea元素进行本机抓取/调整大小.尽管这些 最终可能会在将来(在Microsoft Edge中)得到支持,但您目前最好的选择是对功能进行填充.
Internet Explorer (and Microsoft Edge, as of May 5, 2016) do not support native gripper/resizing on textarea elements. While these may eventually be supported in the future (in Microsoft Edge), the best option you have for now is to polyfill the functionality.
在线上有很多这样做的选项,但是如果您使用的是jQuery和jQuery UI,则可以使用可调整大小的小部件:
Many options exist online that do this, but if you're using jQuery and jQuery UI, you could use the Resizable widget:
$("textarea").resizable({
handles: "se" // place handle only in 'south-east' of textarea
});
默认情况下,这会将处理程序放置在文本区域下方.我不喜欢这样:
By default, this places the handler beneath the textarea. I didn't like this:
.ui-resizable-handle {
transform: translateY(-100%);
}
您可以在此处查看最终结果: http://jsbin.com /rumokazepo/edit?html,css,js,输出
You can see the end-result here: http://jsbin.com/rumokazepo/edit?html,css,js,output
这篇关于如何在IE中将resizer添加到textarea?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!