How to add resizer to textarea in IE?

给你一囗甜甜゛ 提交于 2019-12-22 05:28:18

问题


How to add resizer to textarea in IE the same as in Chrome and Firefox?

jQuery.resizable() won't work for me.


回答1:


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.

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%);
}

You can see the end-result here: http://jsbin.com/rumokazepo/edit?html,css,js,output




回答2:


Can't this be solved in CSS by defining the width and height like so:

.resize {
     width: 100px;
     height: 100px;
 }

 <textarea class="resize"></textarea>


来源:https://stackoverflow.com/questions/11808176/how-to-add-resizer-to-textarea-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!