textarea onresize不起作用 [英] textarea onresize not working
问题描述
根据w3学校<textarea>
支持onresize
,但是它不起作用.
according to w3 schools <textarea>
supports onresize
however it is not working.
http://www.w3schools.com/jsref/event_onresize.asp
浏览器尝试过:
Chrome 25.0.1364.172
Chrome 25.0.1364.172
Safari 6.0.3(7536.28.10)
Safari 6.0.3 (7536.28.10)
Firefox 19.0
Firefox 19.0
字段: http://jsfiddle.net/btevfik/5abR3/
更新
当我在课程中不信任w3schools时,我发现了这一点
as i learned my lesson not to trust w3schools 100%, i found this
https://developer.mozilla.org/zh-CN/docs/DOM/element.onresize
推荐答案
Textareas不会在MOST(ALL)中调整大小,浏览器 onresize 事件是 NOT WORKING FOR 在这种情况下,使用window对象,则使用jQuery UI插件:
Textareas don't resize in MOST(ALL) the browsers onresize event is NOT WORKING FOR the window object in this case, you case use jQuery UI plugin:
$("idoftextarea").resizable({
resize: function() {
$("id").append("yourcode");
}
});
参考: http://jqueryui.com/resizable/
这篇关于textarea onresize不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!