There may be an easier way, but the docs say:
Dragable items get the class u-dragable
so you can do something like:
if(!$("#foo").hasClass("ui-draggable")) {
...
}
to wrap this (untested):
$.fn.isDraggable = function() {
return $(this).hasClass("ui-draggable");
}
console.log($("#someElement").isDraggable());
source
share