我可以让拖动起作用,但调整大小不配合。 (使用文本框或文本区域的行为很明显。)我使用的是 jQuery 1.3.2 和 jQuery UI 1.7.2。
这是我的尝试:
<HTML>
<HEAD>
<TITLE>Drag/Resize TextBox Workbench</TITLE>
<script src="js/jquery.js" type="text/javascript" ></script>
<script src="js/ui/ui.core.js" type="text/javascript"></script>
<script src="js/ui/ui.draggable.js" type="text/javascript"></script>
<script src="js/ui/ui.resizable.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$( "#ta1" ).resizable( { cancel: '' } );
$( "#ta1" ).draggable( { cancel: '' } );
});
</script>
</HEAD>
<BODY>
<form>
<input type='text' class='property' id='tb1' />
<textarea id='ta1' class='property'>Hello</textarea>
</form>
</BODY>
</HTML>
最佳答案
您是否尝试过包装 <textarea>
在 <div>
或另一个 block 级标签并使其可拖动?
关于javascript - 使用 jQuery 可以实现可拖动且可调整大小的文本框/文本区域吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1717589/