固定窗口大小在prettyphoto [英] fixed window-size in prettyphoto

查看:205
本文介绍了固定窗口大小在prettyphoto的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在django应用程序中使用相机照片。我的图像具有最大高度/宽度(带有缩略图),但是色差比是不同的。因此,每次加载下一张/上一张图像时,相机的窗口也会改变它的光圈比和前进/后退按钮更改位置(它们移动)。有没有办法使prettyphoto有一个固定的窗口大小?或者为图像添加边框,以使其格式例如为正方形。但是我不想裁剪图像。



提前感谢
雅克

解决方案

可能没有任何方法可以做你想要的,而无需修改prettyPhoto.js脚本。



有一些选项,可以玩,看看是否可以获得所需的效果:

  $(document).ready(function(){
$(a [rel ^ ='prettyPhoto'])。prettyPhoto({
allow_resize:true,/ *调整大于viewport的大小)true / false * /
default_width:500 ,
default_height:344,
horizo​​ntal_padding:20
});
});

祝你好运!



ian。 / p>

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

解决方案

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.

这篇关于固定窗口大小在prettyphoto的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆