textarea - disable resize on x or y?

吃可爱长大的小学妹 提交于 2019-12-09 07:22:58

问题


I know it's possible to disable the resize of a textarea by using:

textarea {
    resize: none;
}

But is it possible to disable either x or y? instead of both


回答1:


resize: vertical;

or

resize: horizontal;

Quick fiddle: http://jsfiddle.net/LLrh7Lte/




回答2:


Sure it is possible with css and jquery

CSS:

resize: vertical;
resize: horizontal;

jQuery

$('textarea').css("resize", "vertical");
$('textarea').css("resize", "horizontal");

Bootstrap just put the class in Textarea

for the vertical resize: vresize

for the horizontal resize: hresize



来源:https://stackoverflow.com/questions/25567707/textarea-disable-resize-on-x-or-y

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