Skip to content

Commit

Permalink
Insert HTML before first Body element so it works being loaded at bot…
Browse files Browse the repository at this point in the history
…tom of the page
  • Loading branch information
RafaelDesignBE committed May 28, 2018
1 parent 59dc477 commit 9300a84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Example/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<title>Gallery Test</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="../collery.min.css">
<script src="../collery.min.js"></script>
<link rel="stylesheet" href="../collery.css">

</head>
<body>
<div class="preload"></div>
Expand All @@ -25,7 +25,7 @@
</div>
</div>


<script src="../collery.min.js"></script>

</body>
</html>
6 changes: 5 additions & 1 deletion collery.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Collery created by Rafael Fernandez (rafaeldesign.be)
// Created on 05-07-2017
// create gallery HTML
document.write('<div class="gallery"> <div class="next"></div><div class="previous"></div></div><div class="title"></div><div class="close" title="Close (Esc)"> Close <div class="closex"> <div class="line1"></div><div class="line2"></div></div></div><div class="next"> <div class="arrow"></div></div><div class="previous"> <div class="arrow"></div></div><div class="cover"></div>');
var colleryContent = document.createElement("div");
colleryContent.classList.add('collery-content');

colleryContent.innerHTML = '<div class="collery-content"><div class="gallery"> <div class="next"></div><div class="previous"></div></div><div class="title"></div><div class="close" title="Close (Esc)"> Close <div class="closex"> <div class="line1"></div><div class="line2"></div></div></div><div class="next"> <div class="arrow"></div></div><div class="previous"> <div class="arrow"></div></div><div class="cover"></div></div>';
document.body.insertBefore(colleryContent, document.body.firstChild);

// define variables
var index;
Expand Down

0 comments on commit 9300a84

Please sign in to comment.