I have a modal window:

<div class="modal" id="last" style="display: none"> <canvas id="gg" width="372px" height="144px"/> </div> 

If I run it, the canvas will be empty. But you just have to remove style = "display: none", as the canvas draws, in general, I need the canvas to be drawn in my modal window.

    3 answers 3

    Why not assign the desired value of the display in JS'e, before drawing on the canvas?

    • That's the thing) With the code that calls my modal window, puts the display ""))) - LiveD

    Assign the display:block . In general, with an empty string should also work.

      it works

       <canvas id="canvas" width="640" height="480" style="display: none" > 
      • the given code from the working project - Vadim
      • What is the code? What is he to me for? (ps minus did not put minuses) - LiveD
      • @LiveD if you had a question in your question, - that div is a “modal window”, I wouldn’t post. (and about minuses to minuses) - Vadim
      • @LiveD if you have only convas in a div, you can get rid of the div and make the canvas "modal" - Vadim
      • Sadness, but there is not only a canvas, there are still a couple of necessary divs) - LiveD