added img and function to change head image

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-09 14:26:47 +02:00
parent e3d486c0c4
commit ee5e51f3be
2 changed files with 12 additions and 4 deletions

BIN
intro_html/img/head4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -76,28 +76,36 @@
function showNumber1() { function showNumber1() {
document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ ` document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ `
<button onclick="showNumber4()"></button> <button onclick="showNumber4()"></button>
<div style="width: 40px; text-align: center;">1</div> <div style="width: 200px; text-align: center;">
<img src="img/head1.png">
</div>
<button onclick="showNumber2()"></button> <button onclick="showNumber2()"></button>
`; `;
} }
function showNumber2() { function showNumber2() {
document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ ` document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ `
<button onclick="showNumber1()"></button> <button onclick="showNumber1()"></button>
<div style="width: 40px; text-align: center;">2</div> <div style="width: 200px; text-align: center;">
<img src="img/head2.png">
</div>
<button onclick="showNumber3()"></button> <button onclick="showNumber3()"></button>
`; `;
} }
function showNumber3() { function showNumber3() {
document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ ` document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ `
<button onclick="showNumber2()"></button> <button onclick="showNumber2()"></button>
<div style="width: 40px; text-align: center;">3</div> <div style="width: 200px; text-align: center;">'
<img src="img/head3.png">
</div>
<button onclick="showNumber4()"></button> <button onclick="showNumber4()"></button>
`; `;
} }
function showNumber4() { function showNumber4() {
document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ ` document.getElementById('numbersAndButtons').innerHTML = /*HTML*/ `
<button onclick="showNumber3()"></button> <button onclick="showNumber3()"></button>
<div style="width: 40px; text-align: center;">4</div> <div style="width: 200px; text-align: center;">
<img src="img/head4.png">
</div>
<button onclick="showNumber1()"></button> <button onclick="showNumber1()"></button>
`; `;
} }