phaneendravvk

Table row add animation (angular)

Recommended Posts

Hi ,

I'm looking for a table row animation.

In code pen for each regular interval row is added.

Here, can a sort of bounce animation can be achieved from left to right.

 

Kindly help me out!!

 

 

 

 

Thanks

Phaneendra

Share this post


Link to post
Share on other sites

Hi and welcome to the GreenSock forums,

 

Thanks for the demo, but unfortunately I really can't assist you with Angular. 

However, TweenLite can certainly run a transform animation on table rows at certain intervals when they are added to the DOM.

 

var rows = 0;
var maxRows = 10;




function addRow() {
  rows++;
  var row = $("<tr><td>row" + rows + " col1</td><td>col2</td></tr>").appendTo("table")
  TweenLite.from(row, 1, {x:-200, ease:Bounce.easeOut})
  if (rows < maxRows){
    TweenLite.delayedCall(1, addRow)
  }  
}


addRow()

 

https://codepen.io/GreenSock/pen/BzBOKg

  • Like 3

Share this post


Link to post
Share on other sites

Angular provides animation hooks for such things when using ngAnimate. You're trying to do an enter animation, which adds an element to the DOM. I added some buttons to add and remove them...

https://codepen.io/osublake/pen/ab53a6d1f3336b871892a822cd0373e7/?editors=0010

 

A leave animation would be removing the element from the DOM. Here's another enter/leave ngAnimate example...

http://codepen.io/osublake/pen/5d9d6fe688766b469f5d4db88ef069b2?editors=0010

 

It also helps to load your main scripts first so you don't see unrendered stuff like this... {{item.name}}

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.