I'm trying to add text to the placeholder box that shows while dragging the sortable item. is there a function in jQuery's UI that I'm missing? Right now I'm trying to .append()
the info, but it's not working.
Here's the jQuery function:
//Sortable Function - Edit Wizard
$(function () {
//add text to placeholder box
if ($('.ui-state-highlight').is(':visible')) {
$('.ui-state-highlight').append('<span>MOVE HERE</span>');
};
$(".sortable").sortable({
placeholder: "ui-state-highlight",
//revert: true,
grid: [20, 20],
handle: '.editMove',
opacity: 0.6,
scroll: true,
scrollSensitivity: 80,
zIndex: 10
});
$(".sortable").disableSelection();
});
I guess there needs to be some .live()
change function for the .append()
?
You can modify the placeholder from the start callback, like this:
$('#my-sortable').sortable({
start: function(event, ui) {
ui.placeholder.html('Placeholder Content!');
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With