如何在彩色框中滚动打开图像

我希望我在彩色框中打开的图像显示为全尺寸而不应用resize,然后应用滚动条以允许查看较大的图像。 我的一些图像非常高,当resize时,事物会变得像素化。

目前,colorbox只是将我的图像调整到可用高度/宽度的大小。 有没有办法让所有图像显示全尺寸,并在彩盒中可以滚动溢出?

我直接链接到图像:

 image  

我不想将查询字符串添加到我的URL上,所以我想出了这个。

 $(document).ready(function(){ var height = ((window.innerHeight || $window.height()) - 100); var width; $(".iframed-image").each(function() { $("").attr("src", $(this).attr('href')).load(function() { width = this.width; }); $(this).colorbox({ html: '
' }); }); });
       

Image in iframe

Random 640x1044 Image in iframe

您可以使用colorbox在框架中打开图像

只需将?foo=.php添加到URL并将宽度和/或高度设置为小于图像的值。

http://example.com/example.jpg
http://example.com/example.jpg?foo=.php

 $('a.gallery').colorbox({height:'50%'});