Forked from Sillson/get-down-with-down-arrows.js
Last active
August 29, 2015 14:25
-
-
Save g5codyswartz/38b6792e7c4454729b11 to your computer and use it in GitHub Desktop.
Gettin down with down-arrows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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