【问题标题】:fixed window-size in prettyphoto固定漂亮照片中的窗口大小
【发布时间】:2011-09-22 02:09:59
【问题描述】:
我在 django-app 中使用 prettyphoto 作为照片库。我的图像具有最大高度/宽度(使用 sorl-thumbnail),但纵横比不同。因此,prettyphoto 的窗口也会改变它的长宽比,并且每次加载下一张/上一张图像时,前进/后退按钮都会改变位置(它们移动)。有没有办法让 prettyphoto 有一个固定的窗口大小?或者为图像添加边框,使其格式为正方形。但我不想裁剪图像。
提前致谢
雅克
【问题讨论】:
标签:
javascript
django
photo-gallery
sorl-thumbnail
【解决方案1】:
如果不修改 prettyPhoto.js 脚本,可能没有任何方法可以做你想做的事。
prettyPhoto 有一些选项你可以玩,看看你是否能得到想要的效果:
$(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
});
});
祝你好运!
伊恩。