javascript - How to move td content to another td at the same row across borders -
i'm trying code animation push td content (which div inside td) td (to end of row) in same tr across tds borders without changing width of td.
is there way this? css / jquery?
if animation want (the first td content seems "slide" td animation), came (hopefully got question right):
$div = $('td.first > div'); $div .css({position:'relative'}) .animate({ left:$('td.second').offset().left - $('td.first').offset().left }, { complete:function(){ $div.appendto('td.second'); $div.css({position:'', left:''}); }, duration:1000 });
so do?
set position of content "relative". way, can move relative original position.
animate goes should if inside td.second. calculate distance between cells jquery's offset() function
at end of animation, copy div inside second . before visually, not in other td.
we remove instantly position , left css properties. without line the div offset new position.
i did not test , optimized.
Comments
Post a Comment