Fancybox does not scroll in Google Chrome

丶灬走出姿态 提交于 2019-12-10 18:09:50

问题


http://www.mayakaimal.com/media-press

It works in all other browsers I have tested.

<script type="text/javascript">
        $j = jQuery.noConflict();
        $j(function(){
        $j("a.fancybox").fancybox({
            maxWidth    : '100%',
            maxHeight   : '100%',
            fitToView   : false,                   
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none'
        });   
        });
    </script>

回答1:


If the specified fancybox height is more than a certain value, the fancybox will not scroll. Not sure why that is the case.

The below code worked in my case. Play with it to see if it can fix your case.

    height: Math.min(600, $(window).height() - 96)

    $.fancybox({
        width: 800,
        height: Math.min(600, $(window).height() - 96),
        autoScale: false,
        padding: 8,
        href: url,
        scrolling: 'auto',
        hideOnOverlayClick: false,
        centerOnScroll: true,
        transitionIn: 'elastic',
        transitionOut: 'elastic',
        type: 'iframe'
    });



回答2:


This should work:

                    $.fancybox({
                        "href": "putYourURLhere",
                        "width": 500,
                        "height": 500,
                        "autoSize": false,
                        "autoDimensions": false,
                        "scrolling": 'auto',
                        "centerOnScroll": true,
                        "transitionIn": 'elastic',
                        "transitionOut": 'elastic',
                        "type": 'iframe',
                        "onClosed": function () {
                            parent.location.reload(true);
                        }
                    });


来源:https://stackoverflow.com/questions/10214988/fancybox-does-not-scroll-in-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!