更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 |
Xp00000000(留言 | 贡献) 小无编辑摘要 |
||
第67行: | 第67行: | ||
data-current="0" style="cursor:pointer;">4:3</div> | data-current="0" style="cursor:pointer;">4:3</div> | ||
</html>|ccc|png}} | </html>|ccc|png}} | ||
<html> | |||
<div class="state-container" | |||
data-states='["EZ 1", "HD 6", "IN 9"]' | |||
onclick="cycleAndDetect(this)"> | |||
EZ 1 | |||
</div> | |||
<!-- 结果输出区域 --> | |||
<div class="state-result"></div> | |||
<script> | |||
function cycleAndDetect(element) { | |||
// 原始切换逻辑 | |||
const states = JSON.parse(element.dataset.states); | |||
} | const currentIndex = parseInt(element.dataset.current || 0); | ||
const nextIndex = (currentIndex + 1) % states.length; | |||
element.textContent = states[nextIndex]; | |||
element.dataset.current = nextIndex; | |||
// 动态更新检测结果 | |||
const resultDiv = element.closest('.state-container').nextElementSibling; | |||
resultDiv.textContent = `当前状态: ${states[nextIndex]}`; | |||
} | |||
</script> | |||
</html> |
2025年7月2日 (三) 17:32的版本
EZ 1
| |
4:3
|
abc |
EZ 1
| |
4:3
|
a_ccc_1234.png |
EZ 1