[英]Colorbox width doesn't count vertical scrollbar
Hy, HY,
I know a fix exist but i didn't bookmark the page :/ 我知道修复存在,但我没有为页面添加书签:/
I use colorbox to load an iframe containing an image. 我使用colorbox加载包含图像的iframe。 If the iframe is higher that the window height, there is a vertical scrollbar, logic ! 如果iframe高于窗口高度,则有一个垂直滚动条,逻辑! But the width doesn't count the width of the scrollbar and put an horizontal scrollbar too and that suxx ! 但宽度不计算滚动条的宽度,也放置一个水平滚动条和那个suxx! I just want to add 20px more on the width if the height of the image is higher than the "maxHeight" value. 如果图像的高度高于“maxHeight”值,我只想在宽度上增加20px。
Here is the basic code i use : 这是我使用的基本代码:
$("a.colorbox").colorbox({ maxWidth:'90%', maxHeight:'90%', scalePhotos: true, photo:true });
And this is what's happen ! 而这就是发生的事情!
Thanks, 谢谢,
A fix is available here : jeremysawesome patch 这里有一个修复: jeremysawesome补丁
However, it needs a small change for the last version of colorbox (1.5.5) : 但是,它需要对最后一个版本的colorbox(1.5.5)进行一些小改动:
Replace line 640 : if(settings.scrolling){
替换第640行: if(settings.scrolling){
By this one : if(settings.get('scrolling')){
通过这个: if(settings.get('scrolling')){
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.