rivets.binders['src-strict'] = function(el, value) { var img = new Image() img.onload = function() { $(el).attr('src', value) } img.src = value } rivets.binders['transition'] = function(el, display) { if (display) { el.classList.remove('hide'); setTimeout(function() { el.classList.add('show'); }, 0); } else { el.classList.remove('show'); setTimeout(function() { el.classList.add('hide'); }, 200); } } rivets.binders['selected-section'] = function (el, sectionState) { var section = el.text; if (sectionState[section]) { el.classList.add('selected'); } else { el.classList.remove('selected'); } } rivets.binders['cloak'] = function (el) { setTimeout(function() { el.style.opacity = 1; }, 200); }