당신은 드래그 위젯의 handle
옵션을 찾고 :
$("#containers").draggable({
handle: "#cont1"
});
#containers {
height: 100px;
background: grey;
}
#cont1 {
width: 50px;
height: 50px;
background: dodgerblue;
}
#cont2 {
width: 50px;
height: 50px;
background: #eee;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<div id="containers">
<div id="cont1">foo</div>
<div id="cont2">bar</div>
</div>
마우스 입력하거나
#cont1
을 떠날 때
<div id="containers">
<div id="cont1">foo</div>
<div id="cont2">bar</div>
</div>
<script>
$(document).ready(function() {
$("#cont1").mouseenter(function() {
$("#containers").draggable("enable");
});
$("#cont1").mouseleave(function() {
$("#containers").draggable("disable");
});
});
</script>
는 콘솔에 오류가 : 이것은 내 코드입니다
Windows에서 Windows와 비슷한 것을 얻고 싶습니다. 제목 표시 줄을 끌면 전체 창이 드래그되지만 내용을 안에 드래그하여 창을 끌 수는 없습니다. –
'handle' 속성 사용 –