fixed window-size in prettyphoto

JacquesKnie picture JacquesKnie · Jun 24, 2011 · Viewed 11.2k times · Source

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

Answer

ipd picture ipd · Jun 24, 2011

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.