[jQuery] Sortable: get the element that received the sortable?
Hi everyone,
I'm implementing a drag and drop newsletter, where my users can drag
content to different areas of a template.
Depending on where they drop the content, I need to add different HTML
attributes to some of the code (essentially need to make the images
float:left if they're dropped into a certain box).
I've achieved a basic version of this using this code:
$('.review_list').sortable({
receive: function(event, ui) {
// somehow need to make this only apply to competition/
mainfeature
$("img", ui.item).attr("align", "left");
$("img", ui.item).attr("vspace", "4");
$("img", ui.item).attr("hspace", "4");
},
connectWith: '#reviews'
});
This adds align="left" vspace="4" hspace="4" onto any image dropped
into an element with the 'review_list' class (I know I said it was
float:left but this code will be emailed so I have to do it old school
style...).
Anyway: is there a way that I can get the element that has received
the sortable item? It could be one of three in my case, and I only
want this code to be added for two of them.
I guess I could run a cleanup function when submitting that removed
this addition for images in the other element, but this seems messier
- I had assumed that the 'receive' event would return the receiving
element.