try to make compatible with jquery ui draggable