Skip to content

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

@tiagofassoni

Description

@tiagofassoni

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions