Results 1 to 3 of 3

Thread: [RESOLVED] Draggable does not work after I do autopostback from a dropdown list.

  1. #1
    Frenzied Member
    Join Date
    Aug 06
    Posts
    1,752

    Resolved [RESOLVED] Draggable does not work after I do autopostback from a dropdown list.

    Hi All,

    I have a div which contains an image. At the start if I drag the div it works fine but when I select an item from a dropdown list which then assigns a different image to the div the drag stops working. The dropdown has autopostback so I can get the new image.

    Any help please, very new to jquery

    Jiggy!

    PS. Here is my jquery. Also does it matter that the controls are in an updatepanel?

    Code:
                <script type="text/javascript">
                    $(function () {
                        $('#divPreview').draggable({ helper: "clone",
                            cursor: "move"
                        });
                    }); 
                </script>

  2. #2
    Frenzied Member
    Join Date
    Aug 06
    Posts
    1,752

    Re: Draggable does not work after I do autopostback from a dropdown list.

    I believe I need to use pageload. Can someone please help we with this. I understand that after the partial post back it loses the jquery function and need to use pageload but I can't seem to get the syntax correct.

  3. #3
    Frenzied Member
    Join Date
    Aug 06
    Posts
    1,752

    Re: Draggable does not work after I do autopostback from a dropdown list.

    Sorted, here is my code:-

    <script type="text/javascript">
    function pageLoad(){
    $('#divPreview').draggable({ helper: "clone",
    cursor: "move"
    });
    $('#divCleanTool1').droppable({
    drop: function (event, ui) {
    var $imagedrop = $('#divCleanTool1').find('img').map(function () {
    var $imagedrag = $('#divPreview').find('img').map(function () {
    return this.src;
    }).get();
    this.src = $imagedrag;
    });
    }
    });
    };
    </script>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •