này được mã của tôi lấy từ http://jqueryui.com/demos/draggable/Jquery-ui có thể kéo và động Jquery-ui có thể kéo được không?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Draggable - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.6.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.mouse.js"></script>
<script src="../../ui/jquery.ui.draggable.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.draggable { width: 150px; height: 150px; padding: 0.5em; }
</style>
<script>
$(function() {
$(".draggable").draggable();
$('.content').click(function(){
var htmlData='<div class="draggable ui-widget-content ui-draggable"><p>Drag me around</p></div>';
$('.demo').append(htmlData);
});
});
</script>
</head>
<body>
<div class="demo">
<div class="draggable ui-widget-content">
<p>Drag me around</p>
</div>
<div class="content">Test </div>
</div><!-- End demo -->
</body>
</html>
Iam làm thành phần có thể kéo động như bạn có thể nhìn thấy trong chức năng iam sử dụng thêm. Nhưng đối tượng drggable mới được tạo ra không phải là kéo mặc dù tôi đã đưa ra các lớp jquery-ui tạo ra.
cám ơn sau khi gọi kéo một lần nữa giải quyết vấn đề cảm ơn rất nhiều cho bạn. Cảm ơn rất nhiều. –
Đừng quên bao gồm mã của bạn để tham khảo trong tương lai. – Jeffrey
hoạt động này .. +1 –