creativelive / appear

execute callbacks when dom elements appear in and out of view
http://creativelive.github.io/appear/
MIT License
178 stars 43 forks source link

Not capturing live added elements #7

Closed umutkirgoz closed 7 years ago

umutkirgoz commented 8 years ago

As you know, elements is captured on init time (documentReady).

 elements: function elements(){
    // work with all elements with the class "track"
    return document.getElementsByClassName('gptAds');
  }

captures all elements with class gptAds, if I add new elements with that class, they are not tracked by appear

salvatorious commented 7 years ago

You'll need to call appear again after the new live elements are added. Appear attaches the listeners to elements already in the dom when it's called.

JustinBeaudry commented 7 years ago

@salvatorious Is exactly right! We do welcome PR's and/or enhancement tickets!