javascript - Setting width and height of fancybox - Stack Overflow

I've tried the following code with little to no avail:$(document).ready(function(e){$(".ifram

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
    });
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745262384a4619269.html

相关推荐

  • javascript - Setting width and height of fancybox - Stack Overflow

    I've tried the following code with little to no avail:$(document).ready(function(e){$(".ifram

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信