Wie man Leinwandelemente mit CSS stymtHTML

HTML-Programmierer
Anonymous
 Wie man Leinwandelemente mit CSS stymt

Post by Anonymous »

Ich habe viele Figuren und Elemente in der A -HTML -Leinwand. Alle von ihnen haben unterschiedliche Farben, Striche usw. Ich mag es wirklich nicht, dass all diese Werte in meinem JS -Code wandern, da einige Stile im CSS und einige im Code sind. tun: < /p>

Code: Select all

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = 'green'; // I'd like to set with CSS
context.fill();
context.lineWidth = 5; // I'd like to set with CSS
context.strokeStyle = '#003300'; // I'd like to set with CSS
context.stroke();
Http://jsfiddle.net/nedyalkov/ysglqqh3/1/

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post