Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save g5codyswartz/38b6792e7c4454729b11 to your computer and use it in GitHub Desktop.
Save g5codyswartz/38b6792e7c4454729b11 to your computer and use it in GitHub Desktop.
Gettin down with down-arrows
/* Fixes overlap issues */
.row .down-arrow {z-index:0;}
.row .down-arrow.home-arrow {z-index:100;}
</style><script>function insertAfter(referenceNode, newNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
console.log(referenceNode.parentNode);
}
var div = document.getElementsByClassName("row-grid");
var locationName = "[ENTER LOCATION NAME]";
var locationCity = "[ENTER LOCATION CITY]";
var locationState = "[ENTER LOCATION STATE]";
var uPhotoSrc = "[ENTER PHOTO SOURCE]";
var uPhotoAlt = "Custom graphic for "+locationName+" in "+locationCity+", "+locationState;
for (var i=0; i < div.length; i++){
console.log(div[i]);
var el = document.createElement("figure");
el.className = el.className + "photo photo-left down-arrow widget h-media home-arrow";
el.itemType = "http://schema.org/Photograph"
el.innerHTML = "<img class='u-photo' src='"+uPhotoSrc+"' alt='"+uPhotoAlt+"' itemprop='image'>";
insertAfter(div[i], el);
}</script>
<style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment