Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts

    backgroundColor partly updating?

    I have written a javascript version of tetris and at every 10th cleared line, I change the body background color more towards red. However, the page only seems to update parts of the background. It is only after min/maxing the window or otherwise forcing a redraw that the whole page background is actually updated to the correct color.

    Any idea why this is and if/how this can be fixed?


    This line works as expected, but it may be relevant to highlight.
    Code:
    document.body.style.backgroundColor = "rgb(255," +GB+ "," +GB+ ")";

    If you manage to clear 10 lines you can see it yourself.

    Tested in Opera, other browser may have trouble.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You could try setting the body and html css height to 100%
    Code:
    html, body { height: 100%; }


  •  

    Posting Permissions

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