Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add page to CrowdfundHQ using hash in URL
<div class="normal">
<h3>Normal content</h3>
<p>This is what the user normally sees</p>
<a href="/test/liquid#invite">Invite</a>
<div class="invite" style="display:none">
<h3>Invite form</h3>
<p>The invite page</p>
<a href="/test/liquid#">Back</a>
var normal = document.querySelector('.normal')
var invite = document.querySelector('.invite')
function route () {
var hash = window.location.hash
if (hash === '#invite') { = 'none' = 'block'
} else { = 'block' = 'none'
window.addEventListener('hashchange', route)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment