Results 1 to 3 of 3

Thread: Full page canvas problem

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Full page canvas problem

    This may be stupid but I can't seem to get my canvas to fill the whole webpage. I create the canvas with
    Code :
    <body onload="webGLStart();">
     
    	<script type="text/javascript">
    		var X = document.body.clientWidth;
    		var Y = document.body.clientHeight;
    		document.write('<canvas id="test" style="border: none;" width="'+X+'" height="'+Y+'"></canvas>')
    	</script>
     
    </body>

    but I always have scroll bars and the canvas doesn't start at the very top left. There is a little gap. Any ideas?

  2. #2
    Junior Member
    Join Date
    Aug 2010
    Posts
    17

    Re: Full page canvas problem

    You have to play with css, try something like this:
    Code :
    body {
        margin: 0;
        padding: 0;
    }
     
    #test {
        margin: 0;
        padding: 0;
    }

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    9

    Re: Full page canvas problem

    Ah, worked like a charm. Thanks a lot.

Similar Threads

  1. FULL OPENCL EXAMPLE
    By Gamingdrake in forum OpenCL
    Replies: 1
    Last Post: 06-12-2011, 09:25 AM
  2. What happens after a full event queue?
    By jarno in forum OpenML Coding & Technical Issues
    Replies: 0
    Last Post: 08-29-2005, 08:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •