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?

  1. set position of content "relative". way, can move relative original position.

  2. animate goes should if inside td.second. calculate distance between cells jquery's offset() function

  3. at end of animation, copy div inside second . before visually, not in other td.

  4. we remove instantly position , left css properties. without line the div offset new position.

i did not test , optimized.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -