1

我正在尝试修改单击缩略图时打开的图像框的高度和宽度,但没有成功。

到目前为止,这是我的代码

@for (int i = 0; i < Model.count; i++)
{
    <a href= "@Url.Action("GetImage", "Image", new { id = i })" rel="prettyPhoto[pp_gal]">
    <img src= "@Url.Action("GetImage", "Image", new { id = i })" alt="Image @(i+1)" width="240" height="240" /></a>
}    
<script type="text/javascript">
    $(document).ready(function () {
        $("a[rel^='prettyPhoto']").prettyPhoto({
            autoplay_slideshow: false,
            show_title: true,
            default_width: 300, //I have tried playing with these values
            default_height: 200, //I have tried playing with these values
            theme: 'pp_default',
            overlay_gallery: false,                  
            social_tools: false
        });
    });
</script>

任何帮助,将不胜感激。

4

4 回答 4

2

jquery.prettyPhoto.js中,您应该修改以下变量:

imageWidth = v-200;  // change to -30
imageHeight = d-200; // change to -90
于 2014-07-19T19:21:25.830 回答
1

你可以使用allow_resize: false,点击后会显示你原来的图片大小。对于缩略图图像,您需要使用 CSS 类

allow_resize: false , /* 调整照片大小大于视口。真假 */

试试这个。这就是我让它为我工作的方式=)

于 2018-04-16T09:33:11.887 回答
0

我也试过,但同样没有运气。

也有一些作弊:)

检查PrettyPhoto.css文件/css/prettyPhoto.css搜索div.pp_pic_holder并应用所需的宽度!important

Ex.width: 825px !important;

干杯!!!

于 2012-10-03T05:30:28.733 回答
0

使用css轻松控制的简单方法

div.pp_pic_holder { width: 300px!important; }
.pp_content { width: 275px!important; }
a.pp_close { right: 60%; }
div.pp_pic_holder { left: 40%!important; }
于 2016-07-25T13:16:59.720 回答