Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to allow different data attributes if required #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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