Skip to content

Instantly share code, notes, and snippets.

@PatrickKennedy
Last active November 2, 2018 02:40
Show Gist options
  • Save PatrickKennedy/054e7e604f34c12f3eb996f3ce04c4d9 to your computer and use it in GitHub Desktop.
Save PatrickKennedy/054e7e604f34c12f3eb996f3ce04c4d9 to your computer and use it in GitHub Desktop.
function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready(function () {
let typeformButton = document.getElementsByClassName('typeform-share button')[0];
if (window.location.hash === "#getquote") {
typeformButton.click()
}
document
.querySelectorAll('.extra-quote-button')
.forEach(function (element) {
element.addEventListener('click', function () { typeformButton.click() });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment