简体   繁体   中英

Setting width and height of fancybox

I've tried the following code with little to no avail:

    $(document).ready(function(e){
        $(".iframe").fancybox(
                {
                    height: 950,
                    width: 400                        }
        );
    });

I've put everything in quotes and everything without quotes and nothing seems to have any effect of the fancybox. There does seem to be some effect on the width, but it's irregular and temperamental. From what I can tell, all including the width does it set the width to it's default value.

Try:

$(document).ready(function() {
    $(".iframe").fancybox({
       maxWidth  : 950,
       maxHeight : 400,
       fitToView : false,
       width     : '100%',
       height    : '100%',
       autoSize  : false
    });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM