
<q title = "Done with your TPS reports?"> Is this good for the company? </ q>Quote with reference.
<q title = "Done with your TPS reports?"> Is this good for the company? </ q>Quote with remark
<q title = "Zeldman. <em> Designing withnWeb Standards </ em> New Riders, 2003."> We build only to rebuild. </ q>Quote with nested tag.
q and blockquote tags is that the first is a string element and the other is a block element. $ (document) .ready (function () {
$ ("# wrap"). append ("<ol id = \" footnotes \ "> </ ol>");
footnote = 1;
$ ("q [cite], q [title], blockquote [cite], blockquote [title]"). addClass ("footnote");
$ (". footnote"). each (function () {
$ (this) .append ("<sup>" + footnote + "</ sup>");
cite = "<li>";
url = $ (this) .attr ("cite");
title = $ (this) .attr ("title");
if (title && url) {
cite + = "<a href=\""+url+"\">" + title + "</a>";
} else if (title) {
cite + = title;
} else if (url) {
cite + = "<a href=\""+url+"\">" + url + "</a>";
}
cite + = "</ li>";
$ ("# footnotes"). append (cite);
footnote ++; });
});
$ (document) .ready (function () {
$ ("# wrap"). append ("<ol id = \" footnotes \ "> </ ol>");
footnote = 1;
$ ("q [cite], q [title], blockquote [cite], blockquote [title]"). addClass ("footnote");
$ (". footnote"). each (function () {
$ (this) .append ("<sup id = \" sn "+ footnote +" \ "> <a href=\"#sl"+footnote+"\">" + footnote + "</a> </ sup>" );
cite = "<li id = \" sl "+ footnote +" \ ">";
url = $ (this) .attr ("cite");
title = $ (this) .attr ("title");
if (title && url) {
cite + = "<a href=\""+url+"\">" + title + "</a> <a href=\"#sn"+footnote+"\"> To quote </a>";
} else if (title) {
cite + = title;
} else if (url) {
cite + = "<a href=\""+url+"\">" + url + "</a> <a href=\"#sn"+footnote+"\"> To quote </a>";
}
cite + = "</ li>";
$ ("# footnotes"). append (cite);
footnote ++;
});
}); #wrap ), a block with footnotes ( #footnotes ), and then adds the footnotes themselves inside it.See an example.
Script author website (English)
Subscribe to Chernev's notes (RSS)
Source: https://habr.com/ru/post/36958/
All Articles