|
-
Aug 16th, 2012, 06:53 AM
#1
Thread Starter
Frenzied Member
[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>
-
Aug 16th, 2012, 08:22 AM
#2
Thread Starter
Frenzied Member
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.
-
Aug 21st, 2012, 10:24 AM
#3
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|