jQuery prettyPhoto - Setting a max height and width for the lightbox

不问归期 提交于 2019-12-12 03:42:33

问题


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?


回答1:


   $(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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/11647291/jquery-prettyphoto-setting-a-max-height-and-width-for-the-lightbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!