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

Force image height OR width like we want. #11

Open
Darknior opened this issue Jun 19, 2013 · 0 comments
Open

Force image height OR width like we want. #11

Darknior opened this issue Jun 19, 2013 · 0 comments

Comments

@Darknior
Copy link

For my part i use many images not all with same size ...
I only want to force the height to make them all biggest but not go out of the carrousel.
For this i change your fonction like this:

forcedImageHeightOnly: 0,   // Forced height only
forcedImageWidthOnly: 0,    // Forced width only

function forceImageDimensionsIfEnabled() {
  if (options.forcedImageWidth && options.forcedImageHeight) {
    data.itemsContainer.find('img').each(function () {
      $(this).width(options.forcedImageWidth);
      $(this).height(options.forcedImageHeight);
    });
  } else if (options.forcedImageHeightOnly) {
    data.itemsContainer.find('img').each(function () {
      $(this).height(options.forcedImageHeightOnly);
    });
  } else if (options.forcedImageWidthOnly) {
    data.itemsContainer.find('img').each(function () {
      $(this).width(options.forcedImageWidthOnly);
    });
  }
}

I think it can some other people ...

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