Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
javascript:(function (d) {
var tables = d.getElementsByTagName('table'),
head = d.head || d.getElementsByTagName('head')[0],
styleElement = d.createElement('style'),
cssStr = '.table-flip {transition: 1s linear;transform: rotate(360deg);}';
styleElement.type = 'text/css';
styleElement.appendChild(d.createTextNode(cssStr));
head.appendChild(styleElement);
function toggleSpin() {
var i = 0,
length = tables.length;
for(i = 0; i < length; i++) {
tables[i].classList.toggle('table-flip');
}
}
toggleSpin();
setTimeout(function() {
toggleSpin();
}, 1000);
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment