Link to home
Start Free TrialLog in
Avatar of sahanz
sahanz

asked on

jQuery .live

Hello,

i was wondering if there is a way to  assign sortable to $( "#canvas .widget" ) using live method or such ?
$( "#canvas .widget" ).sortable();

Open in new window


Obviously something like this wont work. $( "#canvas .widget" ).live('sortable', function(){});

Any idea ?
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sahanz
sahanz

ASKER

Hi there.

I have this div

<div id="canvas">

</div>

from an ajax call I load some divs in to this #canvas and those are having a class called "widget"

so after getting these div.widget s I want them to be sortable.
you need to make it sortable every time the ajax load finishes
check this explanation
http://stackoverflow.com/questions/4323639/jquery-live-and-sortable
Avatar of sahanz

ASKER

That's what I thought, the ajax call actually append to #canvas and the ajax load works few times, so that means on each load I have to do the sortable right?
Avatar of sahanz

ASKER

Thank you.