这是从http://jqueryui.com/demos/draggable/jquery-ui可拖动和动态的jquery-ui可拖动吗?
<!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使用追加看到了我的代码。但新生成的可驯服的对象不是拖动,虽然我给了jquery-ui生成的类。
感谢呼吁再次拖动后解决这个问题非常感谢你。非常感谢。 –
不要忘记包含您的代码以备将来参考。 – Jeffrey
This works .. +1 –