previous

page 20

next
showing the numbers

← This is what I'm aimimg for.

It's essentially the same as the buttons. In fact, you can use the same CSS.

Below is one line from my index.html.

Note that I've changed the numbers - you must be tired of seeing the same spirolateral every time!

<div id='0' onClick='number(0);'></div>

We'll need a numbers() function to fill in the numbers.

function numbers() {
for (var i=0;i<5;i++) {
var nbr=document.getElementById(i);
nbr.textContent=g_numbers[i];
}
}
function setup() {
g_running=false; stop();
g_side=45*vmin();
var buttons=document.getElementById('buttons');
buttons.style.width=g_side;
var nos=document.getElementById('numbers');
nos.style.width=g_side;
...
numbers();
}
previous
next