开发者

jQuery sortable programmatic manipulation

开发者 https://www.devze.com 2023-03-18 00:25 出处:网络
When you\'re dragging a jQuery sortable element, can you programmatically adjust the position of the element being dragged.I am trying to do this with the following code:

When you're dragging a jQuery sortable element, can you programmatically adjust the position of the element being dragged. I am trying to do this with the following code:

var currentPos = parseInt($(elementbeingdragged).css('left'));
$(elementbeingdragged).css('left',(currentPos-2)+'px');

However, I am getting some strange results. Is there a better API method call I can make to the sortable plugin to more reliably adjust the position of th开发者_开发百科e element being dragged?

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号