Files
bridget/assets/ts/indexDisp.ts
2023-03-16 20:18:11 +08:00

18 lines
584 B
TypeScript

import { duper } from './utils'
// update index of displaying image
export const imgIndexSpanUpdate = (numOne: number, numTwo: number): void => {
// footer index number display module
const footerIndexDisp = document.getElementsByClassName('ftid')
const numOneString: string = duper(numOne)
const numTwoString: string = duper(numTwo)
for (let i: number = 0; i <= 7; i++) {
const footerIndex = footerIndexDisp[i] as HTMLSpanElement
if (i > 3) {
footerIndex.innerText = numTwoString[i - 4]
} else {
footerIndex.innerText = numOneString[i]
}
}
}