2

我正在使用 prettyphoto 作为 django-app 中的照片库。我的图像具有最大高度/宽度(使用 sorl-thumbnail),但纵横比不同。因此,prettyphoto 的窗口也会改变它的长宽比,并且每次加载下一张/上一张图像时,前进/后退按钮都会改变位置(它们移动)。有没有办法让 prettyphoto 有一个固定的窗口大小?或者为图像添加边框,使其格式为正方形。但我不想裁剪图像。

在此先感谢雅克

4

1 回答 1

3

如果不修改 prettyPhoto.js 脚本,可能没有任何方法可以做你想做的事。

你可以使用一些漂亮的照片选项,看看你是否能得到想要的效果:

$(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
  });
});

祝你好运!

伊恩

于 2011-06-24T15:24:32.083 回答