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

If images are loaded dinamically, image sizing does not work #13

Open
tiagofassoni opened this issue Apr 27, 2017 · 0 comments
Open

If images are loaded dinamically, image sizing does not work #13

tiagofassoni opened this issue Apr 27, 2017 · 0 comments

Comments

@tiagofassoni
Copy link

Hey!

First of all, thanks for the nice work. We used it in production, works great.

We used it in a situation it wasn't originally designed for, when images are loaded dinamically.

The function does have an implicit trust on all images being loaded for it to work, so I solved it by adding this code to the beforeAfter function:

    $('.ba-slider > img:first').on('load', function() {
      var width_first_image = $('.ba-slider > img:first').width() + 'px';
      cur.find('.resize img').css('width', width_first_image);
    });

I can make the pull request if you wish - just wanted to discuss and validate the solution first.

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

No branches or pull requests

1 participant