Question: I want store the initial location of a set of "draggable" images as data attributes in the image. Then when a "putBack" button is pressed images will return to their place of origin. Problem is that images return to a relative position. Instead of Top & Left, they are positioned to 2XTop and 2XLeft.

```
    // assign data attributes x,y data attributes       
    $('li img').each(function(index) {
        $(this).data("Left", $(this).parent().position().left)
               .data("Top", $(this).parent().position().top);       
        console.log($(this).data("Top"));
    });

    // button to put images back where they started 
    $("#putBack").bind('click', function() {
        $('li img').each(function(index) {

        console.log($(this).data("Top"));
             $(this).parent().animate(
                     { "left": $(this).data("Left"), 
                             "top": $(this).data("Top")
                     }, "slow");                    
        });

    });

```

html...

```
<ul>
<li id='apple'><img src="images/apple.png"/></li>
<li id='bread'><img src="images/bread.png"/></li>
<li id='banana'><img src="images/banana.png"/></li>
<li id='hot_dog'><img src="images/hot_dog.png"/></li>
<ul>

```

css...

```
ul{
   width:100px;
   padding:0px;
   list-style:none;
   font-size:20px;
}

```

Answer: 
It looks like you're keeping the position of the parent `li` not the `img`. Here's a js fiddle that remembers the images positions and moves them back accordingly: [jsfiddle.net/ps7WN](http://jsfiddle.net/ps7WN)
This did the trick -

```
$(document).ready(function(){ 
    $('li').draggable({
            // revert: true,
            cursor: 'pointer',
            opacity: .4,
            containment: 'document'
    });

    // turn on and off dragging 
    $('.toggle').click(function() {
        if ($( "li" ).draggable( "option", "disabled" ) == true){
            $( "li" ).draggable( "option", "disabled", false );             
            $('.toggle').val('Prevent Draggable');
        }
        else{
            $( "li" ).draggable( "option", "disabled", true );              
            $('.toggle').val('Allow Draggable');
        }
    });

    // assign data attributes x,y data attributes       
    $('li img').each(function(index) {
        $(this).data("Left", $(this).parent().offset().left)
               .data("Top", $(this).parent().offset().top);     
        console.log($(this).data("Top"));
    });

    // button to put images back where they started 
    $("#putBack").bind('click', function() {
        $('li img').each(function(index) {                      
             $(this).parent().animate(                   
                 { "left": 0, 
                         "top": 0
                 }, "slow");                    
        });
    });
}); 

```