mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-10 06:48:26 +00:00
update docs and style
This commit is contained in:
parent
7c6d0e8c34
commit
3599a71af5
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
@ -690,6 +690,7 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
||||
|
||||
<script src="//cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var itemList = [];
|
||||
var targetMap = {};
|
||||
$("[id]", ".main-content").map(function (index, heading) {
|
||||
@ -707,20 +708,17 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
||||
var updateTocActive = function (e) {
|
||||
var windowHeight = window.innerHeight;
|
||||
//find the first item to match
|
||||
var scrollY = window.scrollY;
|
||||
var scrollYThres = window.scrollY + 200;
|
||||
var target;
|
||||
if (scrollY < 100) {
|
||||
if (scrollYThres < 100) {
|
||||
target = itemList[0].tocItem;
|
||||
} else {
|
||||
itemList.forEach(function (item, index) {
|
||||
if (target) return;
|
||||
|
||||
if (index < itemList.length - 1) {
|
||||
if (item.top <= scrollY + windowHeight / 2 && itemList[index + 1].top > scrollY + windowHeight / 2) {
|
||||
target = item.tocItem;
|
||||
if (index > 0) {
|
||||
if (item.top >= scrollYThres) {
|
||||
target = itemList[index - 1].tocItem;
|
||||
}
|
||||
} else {
|
||||
target = item.tocItem;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -731,6 +729,7 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
||||
|
||||
window.onscroll = updateTocActive;
|
||||
updateTocActive();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user