diff --git a/_less/screen.less b/_less/screen.less index 5058d91a..dda2d399 100644 --- a/_less/screen.less +++ b/_less/screen.less @@ -783,6 +783,22 @@ table td,table th{ color:#646464; } +.anchorAf{ + position:relative; +} +.anchorAf a{ + display:none; +} +.anchorAf:hover a{ + display:block; + position:absolute; + width:24px; + left:-24px; + bottom:0; + top:0; + background:url(/img/mini_ico_anchor.png) no-repeat center center; +} + .develdocdisclaimer{ padding:30px 0; background:#fff; diff --git a/en/developer-guide.md b/en/developer-guide.md index 75d1f32e..ee2790c0 100644 --- a/en/developer-guide.md +++ b/en/developer-guide.md @@ -56,3 +56,4 @@ of the following file. --> + diff --git a/en/developer-reference.md b/en/developer-reference.md index 32b5487c..781032f3 100644 --- a/en/developer-reference.md +++ b/en/developer-reference.md @@ -59,3 +59,4 @@ untrusted source. + diff --git a/img/mini_ico_anchor.png b/img/mini_ico_anchor.png new file mode 100644 index 00000000..bd568bc9 Binary files /dev/null and b/img/mini_ico_anchor.png differ diff --git a/img/mini_ico_anchor.svg b/img/mini_ico_anchor.svg new file mode 100644 index 00000000..1da78095 --- /dev/null +++ b/img/mini_ico_anchor.svg @@ -0,0 +1,73 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/js/main.js b/js/main.js index acef19ae..878f82f1 100644 --- a/js/main.js +++ b/js/main.js @@ -361,6 +361,25 @@ addEvent(window,'load',evtimestamp); init(); } +function addAnchorLinks(){ +//Apply anchor links icon on each title displayed on CSS hover +var nodes=[]; +var tags=['H2','H3','H4','H5','H6']; +for(var i=0,n=tags.length;i0)return; + var cl=nodes[i].className.split(' '); + cl.push('anchorAf') + nodes[i].className=cl.join(' '); + var anc=document.createElement('A'); + anc.href='#'+nodes[i].id; + nodes[i].insertBefore(anc,nodes[i].firstChild); +} +} + function updateIssue(e){ //Update GitHub issue link with pre-filled with current page location var t=getEventTarget(e);