Skip to content

Conversation

@eightdotthree
Copy link

I wanted to use Unveil in an Angular project but since Angular takes control of the data-src attribute I needed to be able to change the data attribute Unveil targets for an image src.

This can be done with the following syntax.

$(element).unveil({
    attrib: 'data-unveil-src',
    retinaAttrib: 'data-unveil-retina-src'
});

You should be able to supply one or the other or neither and Unveil will continue to work as it always has.

Ryan Sprake and others added 3 commits July 21, 2015 11:34
Updated to allow for a params object without affecting the original
API. You can now pass an object as the first param. In doing so you can
now update what attribute Unveil will target for an image’s src with
the following code.

$(element).unveil({
  threshold: 10,
  attrib: 'data-unveil-src',
  retinaAttrib: 'data-unveil-retina-src'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant