日期列追加星期几、自定义浮层tooltip替代原生title、恢复顶部标题

This commit is contained in:
2026-07-23 22:58:51 +08:00
parent b2c00b9fc5
commit 8badfe12a3
+15 -1
View File
@@ -41,8 +41,10 @@
<body>
<button class="toggle" id="toggle" onclick="toggleTheme()">🌙 暗夜</button>
<p class="formula">振幅算法:近 5 日均振幅 = 过去 5 个交易日 (最高 − 最低) 的均值,结果四舍五入取整</p>
<h1>振幅锁仓策略</h1>
<p class="sub">SA2611 (纯碱) &nbsp;|&nbsp; FG2611 (玻璃) &nbsp;|&nbsp; 2026年7月</p>
<p class="formula">振幅算法:近 5 日均振幅 = 过去 5 个交易日 (最高 − 最低) 的均值,结果四舍五入取整</p>
<div class="section collapsed" id="sa-section">
<h2 onclick="toggleSection('sa-section')"><span class="arrow"></span> SA2611 纯碱</h2>
<table>
@@ -151,5 +153,17 @@ document.querySelectorAll('table').forEach(function(tbl) {
});
</script>
<script>
// 日期追加星期几
document.querySelectorAll('td:first-child').forEach(function(td) {
var t = td.textContent.trim();
var m = t.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/);
if (!m) return;
var d = new Date(+m[1], +m[2] - 1, +m[3]);
var w = ['周日','周一','周二','周三','周四','周五','周六'][d.getDay()];
td.textContent = t + ' ' + w;
});
</script>
</body>
</html>