Adding Interactive Tutorial files - incomplete

This commit is contained in:
Daniel Xie
2017-05-05 16:27:35 -05:00
parent 9f7d6d7bba
commit e2cbc38920
13 changed files with 492 additions and 127 deletions
+10
View File
@@ -18,4 +18,14 @@ function addOffset(n, percentage) {
var offset = n * (percentage / 100);
return n * (Math.random() * (2 * offset) - offset);
}
//Given an element by its Id(usually an 'a' element), removes all event listeners
//from that element by cloning and replacing. Then returns the new cloned element
function clearEventListeners(elemId) {
var elem = document.getElementById(elemId);
if (elem == null) {console.log("ERR: Could not find element for: " + elemId); return null;}
var newElem = elem.cloneNode(true);
elem.parentNode.replaceChild(newElem, elem);
return elem;
}