使用jQuery是否可以拖动和调整大小的文本框/文本区域? [英] Is a draggable and resizable textbox/textarea possible using jQuery?

查看:111
本文介绍了使用jQuery是否可以拖动和调整大小的文本框/文本区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以花些功夫,但调整大小无法配合. (使用文本框或文本区域可以明显看出该行为.)我使用的是jQuery 1.3.2和jQuery UI 1.7.2.

I can get the drag to work, but the resizing is not cooperating. (The behavior is evident using either the text box or the text area.) I'm using jQuery 1.3.2 and 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>或另一个块级标记中,并使之可拖动?

Have you tried wrapping the <textarea> in a <div> or another block-level tag and making that draggable instead?

这篇关于使用jQuery是否可以拖动和调整大小的文本框/文本区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆