Jump to content
Search Community

Table row add animation (angular)

phaneendravvk test
Moderator Tag

Go to solution Solved by Carl,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

  • Solution

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
Link to comment
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...

See the Pen ?editors=0010 by osublake (@osublake) on CodePen

 

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

See the Pen 5d9d6fe688766b469f5d4db88ef069b2?editors=0010 by osublake (@osublake) on CodePen

 

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

  • Like 2
Link to comment
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.
×
×
  • Create New...