Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/schollz/onetwothree.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/js/caption.js')
-rw-r--r--[-rwxr-xr-x]docs/js/caption.js26
1 files changed, 3 insertions, 23 deletions
diff --git a/docs/js/caption.js b/docs/js/caption.js
index 95bcfdc..b28b04f 100755..100644
--- a/docs/js/caption.js
+++ b/docs/js/caption.js
@@ -1,23 +1,3 @@
-function ready(fn) {
- if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
- var elements = document.querySelectorAll("img");
- Array.prototype.forEach.call(elements, function(el, i) {
- if (el.getAttribute("alt")) {
- const caption = document.createElement('figcaption');
- var node = document.createTextNode(el.getAttribute("alt"));
- caption.appendChild(node);
- const wrapper = document.createElement('figure');
- wrapper.className = 'image';
- el.parentNode.insertBefore(wrapper, el);
- el.parentNode.removeChild(el);
- wrapper.appendChild(el);
- wrapper.appendChild(caption);
- console.log(el);
- console.log(el.outerHTML)
- }
- });
- } else {
- document.addEventListener('DOMContentLoaded', fn);
- }
-}
-window.onload = ready;
+
+
+