html - Make Cursor position in center for ui.helper in jquery-ui draggable method -
i want cursor in center ui.helper of draggable .
i doing this
$(".soclass").draggable({ cursor: "move", helper: 'clone', revert: "invalid", tolerance: "fit", start: function(event, ui){ $(this).draggable("option", "cursorat", { left: math.floor(ui.helper.width() / 2), top: math.floor(ui.helper.height() / 2) }); } });
using i cursor in center after first drop. how can center align cursor right first drop.
you can access offset.click property of draggable instance, pretty setting cursor @ option problem setting option, describe it'll applied next time trigger start event. using property can set on current event. this:
start: function(event, ui){ $(this).draggable('instance').offset.click = { left: math.floor(ui.helper.width() / 2), top: math.floor(ui.helper.height() / 2) };
Comments
Post a Comment