设置jquery弹出大图像的宽度和高度

时间:2013-08-26 05:01:46

标签: jquery image-gallery

我在我的网站上使用了一个jquery弹出库,我想将可调整大小的图像设置为一些固定的高度和宽度。我不能在这里得到确切的代码是我的代码库

  <script type="text/javascript" src="javascripts/top_up-min.js"></script>
<script type="text/javascript">
  TopUp.addPresets({
    "#images a": {
      fixed: 0,
      group: "images",
      modal: 0,
      title: "gallery"

    },

    "#movies": {
      resizable: 0
    }
  });
</script>

和身体部位中的图像代码

  <span id="images">
        <a href="images/photos/1.jpg" toptions="overlayClose = 1">
          <img src="images/thumbnails/1.jpg"/>
        </a>
         <a href="images/photos/1.jpg" toptions="overlayClose = 1">
          <img src="images/thumbnails/1.jpg"/>
        </a>

      </span>

1 个答案:

答案 0 :(得分:0)

图像尺寸可以通过CSS控制。如果您使用jQuery库来显示图像,则会有一个关联的样式表,您可以编辑该样式表以设置显示的图像尺寸。或者可以选择在初始化程序中设置显示的图像宽度。您可以选择覆盖库设置的任何样式。

在自定义样式表中,您可以尝试以下方法,假设固定宽度为300px,

img{width:300px !important;}

a img{width:300px !important;}

#images img{width:300px !important;}

a img{width:300px !important;}

#images a img{width:300px !important;}

添加!important确保它是使用的样式,它应该覆盖您正在使用的库已定义的任何其他样式。 Click for more info on !important

希望这会有所帮助