0
我想在一個使用擴展的已加載頁面的所有元素上創建一個可拖動的div。我已經注入了jquery腳本和以下代碼。這是我的js文件(從http://coursesweb.net/jquery/jquery-ui-draggable-drag複製)用注入的jquery腳本創建一個可拖動的div
$("body").append('<div id="dg2">hello world</div>');
$('#dg2').draggable({
cursor: 'pointer', // sets the cursor apperance
opacity: 0.35, // opacity fo the element while it's dragged
stack: $('#dg2'), // brings the '#dg1' item to front
});
這是在CSS文件
#dg2 {
width:180px;
height:100px;
margin:8px;
top:150px;
z-index:1000;
background:#a7daa8;
}
我看到的div在頁面底部創建。它不能拖拽和移動。 如何在中間創建它並使其能夠移動?請幫忙。
http://jsfiddle.net/anandnat/aBRt5/ –
哎呀。然後在注入jquery-ui時出錯。謝謝。非常感謝。 。 。:D – Charls