Home › Forums › JavaScript › Matching a numerical variable › Reply To: Matching a numerical variable
As far as SVG goes, my understanding is the the 7 segements that make up each number are all exactly the same shape.
So you really only need to define the shape once (as a def
) and then it can be re-used as many times as you require as use
elements which can receive classes and be affected by JQuery (albeit with attr
not class manipulation as such…at least as far as I know)
Then each define each digit as a group of use
elements (an array perhaps, my JQuery is weak at best).
Then once you have the digits defined, JS / JQ can parse any numerical value into it’s component parts and turn the relevant digits on and off
Does that sound right?
At least that’s the way my logical pattern goes.
Here’s one I found with a quick google search.
http://www.letsstartthinking.org/lab/svg/apps/ssd-digital-clock.asp