jQuery를 사용하여 html 입력 텍스트 상자를 드래그 할 수있는 경험이있는 사람이 있습니까?jQuery를 사용하여 텍스트 상자를 드래그 할 수있게 만드는 방법은 무엇입니까?
div 안에 텍스트 상자를 감싸려고했는데 크기를 조정할 수는 있지만 드래그 할 수는 없습니다. div 및 텍스트 상자는 표준 jQuery UI 대화 상자에 배치됩니다. 사실, 나는 대화 상자 안에 draggable과 resizable html 입력 텍스트 상자가 둘 다 필요합니다.
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$("#btnShow").click(function(e) {
$('#dialog').dialog("open");
});
$('#dialog').dialog({
title: "Sample dialog",
resizable: false,
autoOpen: false,
width: 400,
height: 300,
buttons: [{ text: "OK", click: function() { /* do something */ } },
{ text: "Cancel", click: function() { $(this).dialog("close") } }]
});
$('#divText1').draggable({
containment: "parent",
cursor: "move"
}).resizable({
containment: "parent",
handles: "e, w"
});
});
</script>
<input id="btnShow" type="button" value="Show" />
<div id="dialog" title="Dialog Box" style="border: solid 1px black; margin: 0px 0px 0px 0px; padding: 5px 0px 0px 5x;">
<div id="divText1" style="width: 200px; height: 30px;">
<input type="text" style="width: 98%;" value="Hello world!" /><br /><br />
</div>
</div>
가 사전에 감사합니다 다음과 같이
코드입니다.
고란
하면, 자세한 내용 설명해 주시겠습니까? – tesicg
check [this] (http://jqueryui.com/demos/draggable/) – Sajmon
링크를 가져 주셔서 감사합니다. 그러나 div를 드래그하고 크기를 조정하는 방법을 알고 있습니다. 문제는 텍스트 상자를 드래그하고 크기를 조정할 수있게 만드는 방법입니다. – tesicg