我想让一个文本区域可以调整大小。我尝试了 jQuery UI 的“可调整大小”功能,但是,尽管我很喜欢 jQuery,可调整大小的东西还不完全存在。我希望文本区域仅通过底部中心的 handle 调整高度。 jQuery 只允许您调整高度,但显然不允许您将 handle 放在右下角以外的任何地方,尽管文档怎么说。
有人知道这个功能的替代库吗?
最佳答案
你确定吗? handles选项对我来说效果很好。
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="css/ui-lightness/jquery-ui-1.7.2.custom.css"
rel="stylesheet" type="text/css">
</head>
<body>
<div id="welcome" class="ui-widget-content">Hello, world!</div>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("#welcome").resizable({ handles: "n, s" });
});
</script>
</body>
</html>
您可以设置 ui-resizable-handle、ui-resizable-s 和 ui-resizable-n 类的样式。
关于javascript - 什么是使事物可调整大小的好 JS 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1148836/