»
Tiếng AnhTiếng PhápTiếng Việt

In - Ghi chú đơn giản - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Linh tinh » Ghi chú đơn giản
URL: https://www.javascriptbank.com/simple-footnotes.html

Ghi chú đơn giản © JavaScriptBank.comHiệu ứng JavaScript này giúp bạn thêm những chú thích cho những đoạn văn bản dài trên trang web bằng kĩ thuật Document Object Model (DOM).

Phiên bản đầy đủ: jsB@nk » Linh tinh » Ghi chú đơn giản
URL: https://www.javascriptbank.com/simple-footnotes.html



CSS
<style type="text/css">/*     This script downloaded from www.JavaScriptBank.com     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/.jsbank_sample_cont {margin: 20px; padding: 20px;}.jsbank_sample_tit {font-weight: bold; margin-bottom: 10px; padding: 5px; width: auto; background-color: #c0c0c0; border: 5px solid #a0a0a0; color: black; text-align: center;}#footnotes {  font: 1em Verdana Arial, Helvetica, Sans Serif;  margin: 0 25%;}#footnotes small {  color: #666;  vertical-align: top;  padding: 3px;}#footnotes small a {  color: #666;}.notesList {  text-align: left;  color: #666;  font: .8em Arial, Helvetica, Sans Serif;}.notesList li {  line-height: 160%;}.notesList a {  color: #666;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script>// Created by: Krijn Hoetmer :: http://krijnhoetmer.nl/var DOMsupport = document.getElementsByTagName && document.createElement;window.onload = function() {  if (!DOMsupport) return;  var footNoteHolder = document.getElementById('footnotes');  var allNotes = footNoteHolder.getElementsByTagName('small');  var notesList = document.createElement('ol');  notesList.className = 'notesList';  for (var i = 0; i < allNotes.length; i++) {    var newA = document.createElement('a');    newA.id = 'text-' + (i + 1);    newA.setAttribute('href', '#footnote-' + (i + 1));    newA.setAttribute('title', 'Jump to footnote');    newA.appendChild(document.createTextNode('[' + (i + 1) + ']'));    newBackLink = document.createElement('a');    newBackLink.id = 'footnote-' + (i + 1);    newBackLink.setAttribute('href', '#text-' + (i + 1));    newBackLink.setAttribute('title', 'Back to text');    newBackLink.appendChild(document.createTextNode('[return]'));    newNote = document.createElement('li');    newNote.appendChild(document.createTextNode(allNotes[i].firstChild.nodeValue + ' '));    newNote.appendChild(newBackLink);    notesList.appendChild(newNote);    allNotes[i].replaceChild(newA, allNotes[i].firstChild);  }  footNoteHolder.appendChild(document.createElement('hr'));  footNoteHolder.appendChild(notesList);}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<div id="footnotes"><p>Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues.<small>It va esser tam simplic quam Occidental: in fact, it va esser Occidental.</small> A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p><p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<small>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</small> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent.</p><p>Luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<small>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</small> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p><p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<small>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</small> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent.</p><p>Luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<small>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</small> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p></div><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->