Last active
September 18, 2015 08:23
-
-
Save conormcafee/dc2b79fa48ae4d52a104 to your computer and use it in GitHub Desktop.
Apollo Add/Remove
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
btn.addEventListener('click', function (e) { | |
apollo.toggleClass(divTest, 'is-hidden is-visible'); | |
}, false); | |
document.getElementById('btn').addEventListener('click', function (e) { | |
apollo.toggleClass(document.getElementById('divTest'), 'is-hidden is-visible'); | |
}, false); | |
// Class Name Multiple | |
document.getElementById('case-study-btn').addEventListener('click', function (e) { | |
var x = document.getElementsByClassName('name'); | |
for (var i = 0; i < x.length; i++) | |
apollo.toggleClass(x[i], 'is-hidden is-visible'); | |
}, false); | |
// Data Attribute Multiple | |
document.getElementById('case-study-btn').addEventListener('click', function (e) { | |
var x = document.querySelectorAll('[data-name="name"]'); | |
for (var i = 0; i < x.length; i++) | |
apollo.toggleClass(x[i], 'is-hidden is-visible'); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/* Homework*/
document.getElementById('case-study-btn').addEventListener('click', function (e) {
apollo.toggleClass(e.target, 'js-active js-inactive');
//
var y = document.querySelectorAll('[data-post="case-study"]');
for (var i = 0; i < y.length; i++)
apollo.toggleClass(y[i], 'is-hidden is-visible');
}, false);