jQuery - Fancybox: But I don't want scrollbars!

前端 未结 24 2026
醉话见心
醉话见心 2020-12-15 17:37

I am using jQuery Fancybox for a popup registration form here

I would like the form to come up at the size of 450px by 700px but no matter what I set the height and

24条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 17:54

    Using fancybox version: 2.1.5 and tried all of the different options suggest here and none of them worked still showing the scrollbar.

    $('.foo').click(function(e){            
        $.fancybox({
            href: $(this).data('href'),
            type: 'iframe',
            scrolling: 'no',
            iframe : {
                scrolling : 'no'
            }
        });
        e.preventDefault();
    });
    

    So did some debugging in the code until I found this, so its overwriting all options I set and no way to overwrite this using the many options.

    if (type === 'iframe' && isTouch) {
       coming.scrolling = 'scroll';
    }
    

    In the end the solutions was to use CSS !important hack.

    .fancybox-inner {
       overflow: hidden !important;
    }
    

    The line of code responsible is:

    current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
    

    Fancybox used to be a reliable working solution now I am finding nothing but inconsistencies. Actually debating about downgrading now even after purchasing a developers license. More info here if you didn't realize you needed one for commercial project: https://stackoverflow.com/a/8837258/560287

提交回复
热议问题