Skip to content

Instantly share code, notes, and snippets.

View chris-morgan's full-sized avatar

Chris Morgan chris-morgan

View GitHub Profile
@chris-morgan
chris-morgan / details.js
Last active April 15, 2019 15:23 — forked from remy/details.js
/**
* Note that this script is intended to be included at the *end* of the document, before </body>
*/
(function (window, document) {
if ('open' in document.createElement('details')) return;
// made global by myself to be reused elsewhere
var addEvent = (function () {
if (document.addEventListener) {
return function (el, type, fn) {