最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Setting width and height of fancybox - Stack Overflow

programmeradmin1浏览0评论

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
    });
});
发布评论

评论列表(0)

  1. 暂无评论