jQuery prettyPhoto - Setting a max height and widt

2019-09-15 05:49发布

I have installed the Pretty Photo jQuery plugin but I need to set a min and max height and width of the lightbox and can't seem to get it working.

I've tried changing the prettyPhoto.css file and no luck, I tried looking at the prettyPhoto.js file and can't work out how the dimensions are actually set!?

Anyone have any idea how to do this?

3条回答
做个烂人
2楼-- · 2019-09-15 06:06

Look for div.pp_pic_holder in PrettyPhoto.css file /css/prettyPhoto.css and apply required width with !important Ex. width: 825px !important;

查看更多
该账号已被封号
3楼-- · 2019-09-15 06:10

Here is a possible workaround for your problem. This is what helped me the most.

查看更多
Melony?
4楼-- · 2019-09-15 06:15
   $(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
      });
    });

fixed window-size in prettyphoto

查看更多
登录 后发表回答