更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 |
Xp00000000(留言 | 贡献) 小无编辑摘要 |
||
第2行: | 第2行: | ||
<style> | <style> | ||
.normal-style { | .normal-style { | ||
touch-action: manipulation; /* 减少移动端延迟 */ | |||
-webkit-tap-highlight-color: transparent; /* 移除点击高亮 */ | |||
} | } | ||
</style> | </style> | ||
第20行: | 第12行: | ||
// 更新文本内容 | // 更新文本内容 | ||
element.textContent = element.classList.contains("clicked-style") | element.textContent = element.classList.contains("clicked-style") | ||
? " | ? "{{Diff|HD|10}}" | ||
: " | : "{{Diff|IN|14}}"; | ||
// 存储状态 | // 存储状态 | ||
localStorage.setItem('boxState', element.classList.contains("clicked-style")); | localStorage.setItem('boxState', element.classList.contains("clicked-style")); | ||
第32行: | 第24行: | ||
box.classList.toggle("clicked-style", isClicked); | box.classList.toggle("clicked-style", isClicked); | ||
box.textContent = isClicked | box.textContent = isClicked | ||
? " | ? "{{Diff|HD|10}}" | ||
: " | : "{{Diff|IN|14}}"; | ||
} | } | ||
}; | }; | ||
第39行: | 第31行: | ||
<div id="myInteractiveBox" class="normal-style" onclick="toggleColor(this)"> | <div id="myInteractiveBox" class="normal-style" onclick="toggleColor(this)"> | ||
{{Diff|IN|14}} | |||
</div> | </div> | ||
</html> | </html> |
2025年7月1日 (二) 20:47的版本
{{Diff|IN|14}}