Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/479.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 由于内容更改,在初始化后调整fancybox的大小_Javascript_Jquery_Fancybox_Jquery Datatables - Fatal编程技术网

Javascript 由于内容更改,在初始化后调整fancybox的大小

Javascript 由于内容更改,在初始化后调整fancybox的大小,javascript,jquery,fancybox,jquery-datatables,Javascript,Jquery,Fancybox,Jquery Datatables,我正在使用jquery.datatables,您可能知道,datatable是在页面呈现之后初始化的,这意味着高度是在运行时之后设置的。 这里的问题是,fancybox根据页面高度动态设置高度,但由于高度在之后发生了更改,因此它并不是一个好的设置 以下是我如何设置fancybox弹出窗口: height: $(document).height(), width: $(document).width() > maxWidth ? maxWidth : $(document).

我正在使用jquery.datatables,您可能知道,datatable是在页面呈现之后初始化的,这意味着高度是在运行时之后设置的。 这里的问题是,fancybox根据页面高度动态设置高度,但由于高度在之后发生了更改,因此它并不是一个好的设置

以下是我如何设置fancybox弹出窗口:

    height: $(document).height(),
    width: $(document).width() > maxWidth ? maxWidth : $(document).width(),// Acts as max-width, not possible to set that through CSS.
    autoResize: true,
    closeBtn: false,
    type: 'iframe',
    wrapCSS: 'popup'// Custom class added to the fancybox div.
Autoresize是正确的,但在这种情况下它不会改变任何东西

我在这里寻找一个解决方案,同时我为div设置了一个最小高度,但我不太喜欢它,而且它不能正常工作


任何技巧或解决方法?

在内容大小调整后,您可能需要以编程方式运行方法
$.fancybox.update()
,但没有任何效果:/n问题似乎来自其他方面,基本上是一些CSS,设置总的80像素的边距和填充,从而产生溢出并显示滚动条。我还没有一个解决方案,但它似乎没有连接到datatables或fancybox。