How do I make a div full screen?

后端 未结 10 1903
耶瑟儿~
耶瑟儿~ 2020-12-07 10:59

I am using Flot to graph some of my data and I was thinking it would be great to make this graph appear fullscreen (occupy full space on the monitor) upon clicking on a butt

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 11:26

    Use document height if you want to show it beyond the visible area of browser(scrollable area).

    CSS Portion

    #foo {
        position:absolute;
        top:0;
        left:0;
    }
    

    JQuery Portion

    $(document).ready(function() {
       $('#foo').css({
           width: $(document).width(),
           height: $(document).height()
       });
    });
    

提交回复
热议问题