admin管理员组

文章数量:1404352

I'm using prettyphoto for a photo gallery in a django-app. My Images have a maximum height/width (with sorl-thumbnail), but the apect-ratios are different. Because of that, the window of prettyphoto also changes it's apect-ratio and the go-forward/go-back Buttons change positions (they move) everytime it loads the next/previous image. Is there a way to make prettyphoto have a fixed window size? Or add borders to the images so that their format is, for example, square. But I don't want to crop the image.

Thanks in advance Jacques

I'm using prettyphoto for a photo gallery in a django-app. My Images have a maximum height/width (with sorl-thumbnail), but the apect-ratios are different. Because of that, the window of prettyphoto also changes it's apect-ratio and the go-forward/go-back Buttons change positions (they move) everytime it loads the next/previous image. Is there a way to make prettyphoto have a fixed window size? Or add borders to the images so that their format is, for example, square. But I don't want to crop the image.

Thanks in advance Jacques

Share Improve this question asked Jun 24, 2011 at 14:26 JacquesKnieJacquesKnie 211 gold badge1 silver badge2 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

There may not be any way to do what you want without modifying the prettyPhoto.js script.

There are some options to prettyPhoto you could play with, to see if you can get the desired effect:

$(document).ready(function(){
  $("a[rel^='prettyPhoto']").prettyPhoto({
    allow_resize: true, /* Resize the photos bigger than viewport. true/false */
    default_width: 500,
    default_height: 344,
    horizontal_padding: 20
  });
});

Good luck!

ian.

本文标签: javascriptfixed windowsize in prettyphotoStack Overflow