Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Matching a numerical variable Reply To: Matching a numerical variable

#189825
Paulie_D
Member

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 useelements (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