我就是解决不了这个问题。当页面上的一个div
具有属性min-height:100%
时;在用fancybox类点击某个元素后,图像显示,但页面在Y中跳转,以获得带有min-height:100%;
的div的子级的高度
示例:
body{height:100%;}
html{height:100%;}
some_class{
min-height:100%;
background-image:url();
background-size:cover;
background-position:center center;
}
some_absolute_div_in_some_class{
position:absolute;
width:200px;
height:200px;
top:50%;
}
然后我放了一些位置:绝对div-s在some_class
div.中
几天后,当我构建一个页面模板时,我用fancybox放了图库。只有当我删除min-height:100% for some_class
时,它才能正常工作,因为它打开fancybox后,整个页面都会在Y上跳转。
在fancybox.css中删除"高度:自动"来自:
.fancybox-active {
height: auto;
}
由于您没有提供实时页面/演示的链接,我想这与滚动条隐藏有关。您可以通过设置hideScrollbar:false
来禁用该功能。
某些div具有最小高度时的解决方案:100%:
beforeLoad : function(){
jQuery('body').removeClass('fancybox-active').removeClass('compensate-for-scrollbar');
},
所以我需要删除插件为body添加的类。