admin管理员组

文章数量:1417462

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.

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.

Share Improve this question asked Aug 30, 2012 at 20:57 sinθsinθ 11.5k26 gold badges89 silver badges124 bronze badges 1
  • can you show the html code of the .iframe class? – user1512616 Commented Aug 30, 2012 at 21:11
Add a ment  | 

1 Answer 1

Reset to default 6

Try:

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

本文标签: javascriptSetting width and height of fancyboxStack Overflow