---
title: "lightbox大图片撑开问题解决方案"
author: "yanlp"
date: "2011-03-16T15:34:27Z"
tags: []
categories: ["Web前端"]
slug: "lightbox"
draft: false
lastmod: "2011-03-16T15:34:27Z"
id: 964291
url: "https://yanlp.iteye.com/blog/964291"
---

1.lightbox.css中添加:

#lightbox img{ width: auto; height: auto; max-height:400px; max-width:600px;}

 

2.lightbox.js中修改:

 

resizeImageContainer: function( imgWidth, imgHeight) {  
  //把宽度和高度设成固定大小  
  imgWidth = 600;  
  imgHeight = 400;

 

  ... ....