При старте drag
определяется длина элемента в функции start
и присваивается заранее созданной переменной. Как присвоить эту обновленную переменную методу left
объекта cursorAt
?
$('.pl-item').draggable({
revert: true,
cursorAt: {
left: cursorShift,
top: 12
},
start: function () {
plName = $('.pl-name span', this).text();
plColor = $('.pl-color span', this).css('background-color');
plLength = parseInt($('.pl-info .pl-duration', this).attr('data-duration'));
$('.pl-images', this).hide();
$('.pl-name', this).hide();
$('.pl-duration', this).hide();
$('.pl-count', this).hide();
$('.pl-color', this).hide();
$(this).css({
'background-color': plColor,
'width': plLength + 'px',
'height': '24px',
'border': 'none'
});
}
});
Есть мысли что это нужно делать как-то через вызов функции в которой эта переменная будет обновляться, но не могу придумать как. Спасибо.