2

我通过以下方式将我的引文链接到我的尾注,并将我的尾注链接到我的参考书目:

<h1>Title</h1>
<hr />

<p>This is a citation where "[1]" links to "&uarr;" in Endnotes and vice-versa.<a id="citation1" href="#endnote1"><sup>[1]</sup></a></p>

<h1>Endnotes</h1>
<hr />

<ol>
 <li><a id="endnote1" href="#citation1">&uarr;</a>This is an endnote where this <a href="#Short title of reference"><i>Short title of reference</i></a> links to entire <i>reference</i> in Bibliography.</li>
</ol>

<h1>Bibliography</h1>
<hr />

<ul>
 <li><a id="Short title of reference">Here goes the entire <i>reference</i>.</a></li>
</ul>

产生:

标题


这是一个引文,其中“[1]”链接到尾注中的“↑”,反之亦然。[1]

尾注


  1. ↑这是一个尾注,此参考文献的简短标题链接到参考书目中的整个参考文献。

参考书目


  • 这是整个参考

现在我希望 [1]、↑ 和参考的短标题链接到的项目在相应链接将我带到它时突出显示。怎么能做到这一点?

4

1 回答 1

0

这是如何:

  <h1>Title</h1>
  <hr/>

  <p>This is a citation.<sup><a id="citation_1" href="#endnote_1" onfocus="highlight(this)" onblur="deHighlight(this)">[1]</a></sup></p>

  <h1>Endnotes</h1>
  <hr/>

  <ol>
    <li><a id="endnote_1" href="#citation_1" onfocus="highlight(endnote_1Content)" onblur="deHighlight(endnote_1Content)">&uarr;</a><span id="endnote_1Content">This is an endnote citing this <abbr title="Full book title"><a href="#bibliography_1">Short title</a></abbr> for a book.</span></li>
  </ol>

  <h1>Bibliography</h1>
  <hr />

  <ul>
    <li><a id="bibliography_1" href="#" onfocus="highlight(bibliography_1Content)" onblur="deHighlight(bibliography_1Content)"></a><span id="bibliography_1Content">This is a reference for the entire book.</span></li>
  </ul>

  <script>
    function highlight(x) {
      x.style.background = "lightgrey";
    }

    function deHighlight(x) {
      x.style.background = "";
    }
  </script>
于 2017-07-28T21:25:45.973 回答