Wie man Leinwandelemente mit CSS stymt

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie man Leinwandelemente mit CSS stymt

by Anonymous » 11 Aug 2025, 08:11

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/

Top