更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 |
Xp00000000(留言 | 贡献) 小无编辑摘要 |
||
第69行: | 第69行: | ||
<html> | <html> | ||
<div | <!-- 状态切换按钮 --> | ||
<div id="state-switcher" data-states='["EZ 1", "HD 6", "IN 9"]' onclick="switchState(this)"> | |||
EZ 1 | EZ 1 | ||
</div> | </div> | ||
<!-- | <!-- 其他输出区域 --> | ||
<div | <div id="output-area-1"></div> | ||
<div id="output-area-2"></div> | |||
<script> | <script> | ||
function | function switchState(element) { | ||
// | // 切换状态 | ||
const states = JSON.parse(element.dataset.states); | const states = JSON.parse(element.dataset.states); | ||
const | const nextIndex = (parseInt(element.dataset.current || 0) + 1 % states.length; | ||
const newState = states[nextIndex]; | |||
element.textContent = newState; | |||
element.dataset.current = nextIndex; | element.dataset.current = nextIndex; | ||
// | // 检测其他区域并更新内容 | ||
const | updateOutputs(newState); | ||
} | |||
function updateOutputs(state) { | |||
const output1 = document.getElementById('output-area-1'); | |||
const output2 = document.getElementById('output-area-2'); | |||
// 根据状态检测并输出不同内容 | |||
if (state === "EZ 1") { | |||
output1.textContent = "检测到状态: EZ 1 → 输出A"; | |||
output2.innerHTML = "<span style='color:green'>✓ 条件满足</span>"; | |||
} | |||
else if (state === "HD 6") { | |||
output1.textContent = "检测到状态: HD 6 → 输出B"; | |||
output2.innerHTML = "<span style='color:blue'>⚠️ 注意阈值</span>"; | |||
} | |||
else if (state === "IN 9") { | |||
output1.textContent = "检测到状态: IN 9 → 输出C"; | |||
output2.innerHTML = "<span style='color:red'>✗ 超限</span>"; | |||
} | |||
} | } | ||
</script> | </script> | ||
</html> | </html> |
2025年7月2日 (三) 18:01的版本
EZ 1
| |
4:3
|
abc |
EZ 1
| |
4:3
|
a_ccc_1234.png |
EZ 1