Since you are using the getter version of data()
, it will look only at the first element in the given set, which does not have the said data attributes.
Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
The solution is to use an attribute exists selector to target the correct element then fetch the data value. something like
var uplifted = effectData.filter('[data-uplifted]').data("uplifted");
Demo: Fiddle