Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JS]Nie wyświetla zawartości znacznika canvas
Gamoń
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 23.03.2012

Ostrzeżenie: (0%)
-----


Witam. Nie wyświetla mi w żadnej przeglądarce zawartości znacznika canvas co robię źle ?

Kod
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" href="de.css" />
    <script src="js/custom.js"></script>
  </head>
  <body>
        dawdwadwd
    <canvas id="draw" width="500" height="300">
    Wyświetli to jak canvas nie działa
    </canvas>

  </body>
</html>

Kod
var canvas = document.getElementById('canvas');
if (canvas.getContext){

  var c = canvas.getContext('2d');

  c.beginPath();
  c.moveTo(35, 10);
  c.lineTo(60, 40);
  c.lineTo(10, 40);
  c.lineTo(35, 10);
  c.stroke();
  
  c.fillText('a',30,60);
  c.fillText('c',110,60);
  c.fillText('b',70,130);
}


Ten post edytował Gamoń 16.05.2012, 18:42:31
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 05:13