jquery:drag後取得物件的座標

詳解

// Make images draggable.
$(“.item”).draggable({

    // Find original position of dragged image.
    start: function(event, ui) {

        // Show start dragged position of image.
        var Startpos = $(this).position();
        $(“div#start”).text(“START: nLeft: “+ Startpos.left + “nTop: ” + Startpos.top);
    },

    // Find position where image is dropped.
    stop: function(event, ui) {

        // Show dropped position.
        var Stoppos = $(this).position();
        $(“div#stop”).text(“STOP: nLeft: “+ Stoppos.left + “nTop: ” + Stoppos.top);
    }
});

<div id=”container”>
    <img id=”productid_1″ src=”images/pic1.jpg” class=”item” alt=”” title=”” />
    <img id=”productid_2″ src=”images/pic2.jpg” class=”item” alt=”” title=”” />
    <img id=”productid_3″ src=”images/pic3.jpg” class=”item” alt=”” title=”” />
</div>

<div id=”start”>Waiting for dragging the image get started…</div>
<div id=”stop”>Waiting image getting dropped…</div>

買了冷氣

買了人生中的第一台冷氣

其實是買了兩台

臥室一台(窗型) 跟 電腦房一台(分離式)

裝修師父搞了一個下午才弄好

客廳太大了 所以沒裝 等過一陣子有賺到大錢再買超大台的(大概明年了吧)