diff --git a/振幅锁仓策略/index-FG.html b/振幅锁仓策略/index-FG.html
index 18eaa00..1fc0ef5 100644
--- a/振幅锁仓策略/index-FG.html
+++ b/振幅锁仓策略/index-FG.html
@@ -182,10 +182,14 @@ function toggleSection(id) {
document.getElementById(id).classList.toggle('collapsed');
}
function openSection(id) {
- document.querySelectorAll('.section').forEach(function(s) { s.classList.add('collapsed'); });
var el = document.getElementById(id);
- el.classList.remove('collapsed');
- el.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ if (el.classList.contains('collapsed')) {
+ document.querySelectorAll('.section').forEach(function(s) { s.classList.add('collapsed'); });
+ el.classList.remove('collapsed');
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ } else {
+ el.classList.add('collapsed');
+ }
}
var activeRow = null;
diff --git a/振幅锁仓策略/index-SA.html b/振幅锁仓策略/index-SA.html
index 776d777..8e42d80 100644
--- a/振幅锁仓策略/index-SA.html
+++ b/振幅锁仓策略/index-SA.html
@@ -182,10 +182,14 @@ function toggleSection(id) {
document.getElementById(id).classList.toggle('collapsed');
}
function openSection(id) {
- document.querySelectorAll('.section').forEach(function(s) { s.classList.add('collapsed'); });
var el = document.getElementById(id);
- el.classList.remove('collapsed');
- el.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ if (el.classList.contains('collapsed')) {
+ document.querySelectorAll('.section').forEach(function(s) { s.classList.add('collapsed'); });
+ el.classList.remove('collapsed');
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ } else {
+ el.classList.add('collapsed');
+ }
}
var activeRow = null;